summaryrefslogtreecommitdiffstats
path: root/platform-logic/generic-resource-api/src/main/xml
diff options
context:
space:
mode:
authorBrandon, Bruce (bb2697) <bb2697@att.com>2018-07-26 18:10:42 +0000
committerBrandon, Bruce (bb2697) <bb2697@att.com>2018-07-26 18:10:42 +0000
commit5a41e5c15bdbfba0e84e89e13bb06d9930988e77 (patch)
tree72fa804d3fc3f1e286e3c8e1209309e97a3ff528 /platform-logic/generic-resource-api/src/main/xml
parent3b79de733187d2c1c9bccf626958a43bb06dbf2e (diff)
Generic resource API DG catch up
Generic resource API DG catch up with several new capabilities Change-Id: I6ba4a1716693a2fb0ba5314f60038277a50249a3 Issue-ID: SDNC-403 Signed-off-by: Brandon, Bruce (bb2697) <bb2697@att.com> Former-commit-id: dd97cf829ce1c0b3bbb0e98e93a2e6619d945beb
Diffstat (limited to 'platform-logic/generic-resource-api/src/main/xml')
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_aai-get-aic-zone.xml124
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_aai-get-network-instance-group.xml95
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-activate.xml560
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-create.xml1443
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-deactivate.xml618
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-delete.xml332
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_assign-vlan-tags.xml441
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_auto-ip-assignment.xml1593
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-activate.xml586
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-assign.xml1962
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-create.xml688
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-deactivate.xml573
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-delete.xml484
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-unassign.xml459
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation.xml82
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_create-l3-subnet.xml315
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_create-route-target-and-vpn-binding.xml437
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_eipam-allocate-generic-subnet.xml1127
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_eipam-allocate-network-role-subnet.xml641
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_eipam-create-generic-pool.xml901
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_eipam-create-network-role-pool.xml968
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-FQPN.xml472
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-allottedresource-id.xml68
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-host-routes-host-route-id.xml67
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-l3network-network-id.xml92
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-panorama-name.xml233
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-subnets-subnet-id.xml66
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-unique-name.xml807
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-vpn-binding-id.xml65
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generic-configuration-notification-activate.xml108
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generic-configuration-notification-assign.xml485
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generic-configuration-notification-deactivate.xml108
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generic-configuration-notification-unassign.xml353
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generic-configuration-notification.xml39
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generic-configuration-topology-operation.xml117
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_get-complex-resource-service-model.xml181
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_get-data-from-policy.xml204
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-composite-match-pair.xml1912
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-create-composite-path.xml627
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-create-simple-path.xml749
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-populate-from-grapi.xml145
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-populate-from-vnfapi.xml569
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-simple-match-pair.xml125
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-topology-operation-create.xml55
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-topology-operation.xml36
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_naming-policy-generate-name.xml1116
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_naming-policy-generate-unique-name.xml182
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-activate.xml260
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-assign-automated.xml1405
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-assign-from-preload.xml952
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-assign-vlantagging-instancegroup.xml1097
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-assign.xml882
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-changeassign.xml1172
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-deactivate.xml221
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-unassign.xml586
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation.xml359
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_policy-manager-create-policy.xml77
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_policy-manager-delete-policy.xml77
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_policy-update-notify-operation.xml131
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-get-policy.xml113
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-rollback-capacity-db.xml52
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-activate-async.xml765
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-activate-sync.xml57
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-assign-async.xml2253
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-assign-sync.xml124
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-async.xml88
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-create-vnfcs.xml293
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-deactivate-async.xml373
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-deactivate-sync.xml57
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-disable.xml184
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-enable.xml231
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-mapping-pprobe.xml108
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-mapping-vprobe.xml243
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-unassign.xml153
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-validation.xml237
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation.xml90
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_preload-network-topology-operation.xml34
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_preload-vf-module-topology-operation.xml34
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_process-eipam-pools.xml36
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_process-generic-eipam-pools.xml661
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_query-aai-l3-network-by-network-role.xml199
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_rollback-eipam-ip-assignment.xml46
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_rollback-generated-names.xml336
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-activate.xml268
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-assign.xml628
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-create.xml227
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-deactivate.xml268
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-delete.xml235
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-unassign.xml186
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation.xml82
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-aai-vfmodule-put.xml171
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-alts-assignment.xml653
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-capability-param-resolution.xml192
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-create-vpe-pool.xml486
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-eipam-create-pool.xml157
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-eipam-ip-assignment.xml269
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-generate-FQPN.xml129
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-generate-name.xml453
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-mac-address-assign.xml615
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-unresolved-composite-data.xml440
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vf-module-assign.xml551
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vf-module-unassign.xml224
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vfmodule-ra-assignment.xml213
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vlan-tag-assign.xml262
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vnf-assign.xml490
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vnf-ra-assignment.xml199
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vnf-unassign.xml153
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation-assign.xml316
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation-changeassign.xml63
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation-deactivate.xml99
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation-delete.xml162
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation.xml65
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-api-contrail-route-input.xml319
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-contrail-route-input.xml499
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-generic-configuration-input.xml108
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-getpathsegment-input.xml107
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-network-input.xml150
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-security-zone-input.xml485
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-service-input.xml166
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-vf-module-input.xml160
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-vnf-input.xml176
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-assign-rollback.xml188
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-activate.xml276
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-no-preload.xml1302
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-preload.xml559
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-assign.xml2565
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-changeassign.xml125
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-deactivate.xml250
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-unassign.xml346
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation.xml59
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-activate.xml313
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-assign.xml791
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-deactivate.xml88
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-ip-addresses.xml289
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-get-resource-request.xml242
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-activate.xml148
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-assign.xml1296
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-changeassign.xml81
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-deactivate.xml135
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-unassign.xml190
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation.xml115
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/SUBNET-API_managed-network-notification.xml230
-rwxr-xr-xplatform-logic/generic-resource-api/src/main/xml/SUBNET-API_subnet-allocated-notification.xml1081
143 files changed, 50321 insertions, 8170 deletions
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_aai-get-aic-zone.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_aai-get-aic-zone.xml
new file mode 100755
index 00000000..5f174c66
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_aai-get-aic-zone.xml
@@ -0,0 +1,124 @@
+<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='aai-get-aic-zone' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='aaiapi.output.cloud-zone' value='' />
+ <parameter name='aaiapi.output.complex-name' value='' />
+ <parameter name='aaiapi.output.aic-clli' value='' />
+ </set>
+ <switch test='`$aaiapi.input.cloud-owner`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error aaiapi.input.network-instance-group-id is NULL" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$aaiapi.input.cloud-region-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error aaiapi.input.network-instance-group-id is NULL" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cloud-region"
+ key="cloud-region.cloud-owner = $aaiapi.input.cloud-owner AND
+ cloud-region.cloud-region-id = $aaiapi.input.cloud-region-id AND
+ depth = '0'"
+ pfx='aai.cloud-region' local-only='false' >
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Cloud region not found in AAI"/>
+ </set>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$tmp.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error retrieving cloud region from AAI"/>
+ </set>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$tmp.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <switch test='`$aai.cloud-region.relationship-list.relationship_length`'>
+ <outcome value='0'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Cloud region missing relationships in AAI"/>
+ </set>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$tmp.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Cloud region missing relationships in AAI"/>
+ </set>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$tmp.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <for silentFailure='false' index='ridx' start='0' end="`$aai.cloud-region.relationship-list.relationship_length`" >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='complex.physical-location-id'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.complex-found' value='true' />
+ </set>
+ <set>
+ <parameter name='aaiapi.output.aic-clli' value='`$aai.complex.physical-location-id`' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="complex"
+ key="complex.physical-location-id = $aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.complex' local-only='false' ></get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <switch test='`$tmp.complex-found`'>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Complex not found in AAI"/>
+ </set>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$tmp.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='aaiapi.output.cloud-zone' value='`$aai.cloud-region.cloud-zone`' />
+ <parameter name='aaiapi.output.complex-name' value='`$aai.cloud-region.complex-name`' />
+ </set>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_aai-get-network-instance-group.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_aai-get-network-instance-group.xml
new file mode 100755
index 00000000..7383c3f3
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_aai-get-network-instance-group.xml
@@ -0,0 +1,95 @@
+<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='aai-get-network-instance-group' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='aaiapi.output.collection-customization-uuid' value='' />
+ <parameter name='aaiapi.output.collection-name' value='' />
+ <parameter name='aaiapi.output.collection-function' value='' />
+ <parameter name='aaiapi.output.collection.collection-id' value='' />
+ </set>
+ <switch test='`$aaiapi.input.network-instance-group-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error aaiapi.input.network-instance-group-id is NULL" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="instance-group"
+ key="instance-group.id = $aaiapi.input.network-instance-group-id"
+ local-only="false"
+ pfx="tmp.AnAI.networkInstanceGroup">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving network instance group with id=' + $aaiapi.input.network-instance-group-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'network instance group id: ' + $aaiapi.input.network-instance-group-id + 'not found in AnAI'`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <for silentFailure='true' index='ridx' start='0' end="`$tmp.AnAI.networkInstanceGroup.relationship-list.relationship_length`" >
+ <for silentFailure='true' index='rdidx' start='0' end="`$tmp.AnAI.networkInstanceGroup.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$tmp.AnAI.networkInstanceGroup.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='collection.collection-id'>
+ <block atomic="true">
+ <set>
+ <parameter name='aaiapi.output.collection.collection-id' value='`$tmp.AnAI.networkInstanceGroup.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <switch test='`$aaiapi.output.collection.collection-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'network instance group id: ' + $aaiapi.input.network-instance-group-id + ' collection not found in AnAI'`" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="collection"
+ key="collection.collection-id = $aaiapi.output.collection.collection-id"
+ local-only="false"
+ pfx="tmp.AnAI.collection">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving collection with id=' + $aaiapi.output.collection.collection-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'collection: ' + $aaiapi.output.collection.collection-id + 'not found in AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='aaiapi.output.collection-customization-uuid' value='`$tmp.AnAI.collection.collection-customization-id`' />
+ <parameter name='aaiapi.output.collection-name' value='`$tmp.AnAI.collection.collection-name`' />
+ <parameter name='aaiapi.output.collection-function' value='`$tmp.AnAI.collection.collection-function`' />
+ </set>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-activate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-activate.xml
new file mode 100644
index 00000000..658cee15
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-activate.xml
@@ -0,0 +1,560 @@
+<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='api-contrail-route-topology-operation-activate' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-api-contrail-route-input' mode='sync' ></call>
+ <set>
+ <parameter name='tmp.ar.allotted-resource-id' value='`$cto-api.contrail-route-allotted-resource-id`' />
+ <parameter name='tmp.ar.parent-service-instance-id' value='`$cto-api.parent-service-instance-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/contrail-route-topology/'` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name='bk-cr-ar' value='$mdsal-ar.' />
+ </set>
+ <set>
+ <parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' />
+ </set>
+ <switch test='`$ar.allotted-resource-data.allotted-resource-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="`'Existing contrail-route-allotted-resource with order status of ' + $ar.allotted-resource-data.allotted-resource-oper-status.order-status + ', expecting Created.'`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Contrail Route not found" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Contrail Route not found" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='ar-assignments.' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.`" />
+ </set>
+ <switch test='`$ar-assignments.source-network.network-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error activating contrail route. Source network not found" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </switch>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $ar-assignments.source-network.network-id"
+ local-only="false"
+ pfx="aai.src-network">
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='virtual-network-fqdn-split' />
+ <parameter name='original_string' value='`$aai.src-network.contrail-network-fqdn`' />
+ <parameter name='regex' value=':' />
+ </execute>
+ <switch test='`$virtual-network-fqdn-split_length`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Unable to determine network fq-name from contrail fqdn' />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='src-virtual-network-fqname' value='`$virtual-network-fqdn-split[$virtual-network-fqdn-split_length - 1]`' />
+ </set>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='fqname-to-uuid' />
+ <parameter name='api-action' value='get' />
+ <parameter name='resp-prefix' value='uuidresp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='fqname-type' value='virtual-network' />
+ <parameter name='policy-name' value='`$src-virtual-network-fqname`' />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to find network uuid for Contrail to source network" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='src-uuid' value='`$uuidresp.uuid`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='apply' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$uuidresp.uuid`' />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to apply policy in Contrail to source network" />
+ </return>
+ </outcome>
+ </execute>
+ <switch test='`$ar-assignments.dest-network.network-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error activating contrail route. Destination network not found" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </switch>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.dest-network.network-id"
+ local-only="false"
+ pfx="aai.dest-network">
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ </get-resource>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='virtual-network-fqdn-split' />
+ <parameter name='original_string' value='`$aai.dest-network.contrail-network-fqdn`' />
+ <parameter name='regex' value=':' />
+ </execute>
+ <switch test='`$virtual-network-fqdn-split_length`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Unable to determine network fq-name from contrail fqdn' />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='dest-virtual-network-fqname' value='`$virtual-network-fqdn-split[$virtual-network-fqdn-split_length - 1]`' />
+ <parameter name='dest-default-project' value='`$virtual-network-fqdn-split[$virtual-network-fqdn-split_length - 2]`' />
+ </set>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='fqname-to-uuid' />
+ <parameter name='api-action' value='get' />
+ <parameter name='resp-prefix' value='uuidresp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$dest-default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='fqname-type' value='virtual-network' />
+ <parameter name='policy-name' value='`$dest-virtual-network-fqname`' />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to find network uuid for Contrail to destination network" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='dest-uuid' value='`$uuidresp.uuid`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='apply' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$uuidresp.uuid`' />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$src-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to apply policy in Contrail to destination network" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy:relationship-list"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link"
+value="`'/aai/v$/network/l3-networks/l3-network/' + $ar-assignments.source-network.network-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[1].related-link"
+value="`'/aai/v$/network/l3-networks/l3-network/' + $ar-assignments.dest-network.network-id`" />
+ <outcome value='failure'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$src-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to save network policy in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$src-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to save network policy in AAI" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $ar.allotted-resource-data.contrail-route-topology.allotted-resource-identifiers.parent-service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="operational-status" value="in-service-path" />
+ <parameter name="orchestration-status" value="activated" />
+ <outcome value='failure'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$src-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$src-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </return>
+ </block>
+ </outcome>
+ </update>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Active' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$src-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$src-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" />
+ </return>
+ </block>
+ </outcome>
+ </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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-create.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-create.xml
new file mode 100644
index 00000000..674e5470
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-create.xml
@@ -0,0 +1,1443 @@
+<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='api-contrail-route-topology-operation-create' mode='sync'>
+ <block atomic="true">
+ <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.api-contrail-route-topology-operation-create"/>
+ <parameter name='field3' value='cto-api.parent-service-instance-id' />
+ <parameter name='field4' value='`$cto-api.parent-service-instance-id`' />
+ <parameter name='field5' value='cto-api.default-domain' />
+ <parameter name='field6' value='`$cto-api.default-domain`' />
+ <parameter name='field7' value='cto-api.port-mirror-configuration-instance-id' />
+ <parameter name='field8' value='`$cto-api.port-mirror-configuration-instance-id`' />
+ <parameter name='field9' value='cto-api.service-type' />
+ <parameter name='field10' value='`$cto-api.service-type`' />
+ <parameter name='field11' value='cto-api.source-network-role' />
+ <parameter name='field12' value='`$cto-api.source-network-fole`' />
+ <parameter name='field13' value='cto-api.collector-network-role' />
+ <parameter name='field14' value='`$cto-api.collector-network-4ole`' />
+ <parameter name='field15' value='cto-api.default-project' />
+ <parameter name='field16' value='`$cto-api.default-project`' />
+ <parameter name='field17' value='cto-api.cloud-region-id' />
+ <parameter name='field18' value='`$cto-api.cloud-region-id`' />
+ <parameter name='field19' value='cto-api.cloud-owner' />
+ <parameter name='field20' value='`$cto-api.cloud-owner`' />
+ <parameter name='field21' value='cto-api.isTest' />
+ <parameter name='field22' value='`$cto-api.isTest`' />
+ <parameter name='field23' value='cto-api.owning-entity' />
+ <parameter name='field24' value='`$cto-api.owning-entity`' />
+ </record>
+ <set>
+ <parameter name="ctotmp." value="" />
+ <parameter name="ar-request-information." value="" />
+ <parameter name="ar-created" value="" />
+ <parameter name="ar-aai-created" value="" />
+ <parameter name="np-aai-created" value="" />
+ <parameter name="contrail-created" value="" />
+ </set>
+ <set>
+ <parameter name="ctotmp.s-l3-network" value="" />
+ <parameter name="ctotmp.num-s-network" value="0" />
+ <parameter name="ctotmp.s-network-policy" value="" />
+ <parameter name="ctotmp.num-s-np" value="0" />
+ <parameter name="ctotmp.c-l3-network" value="" />
+ <parameter name="ctotmp.num-c-network" value="0" />
+ <parameter name="ctotmp.c-network-policy" value="" />
+ <parameter name="ctotmp.num-c-np" value="0" />
+ <parameter name="ctotmp.s-network-policy-list_length" value="0" />
+ <parameter name="ctotmp.c-network-policy-list_length" value="0" />
+ <parameter name="ctotmp.network-policy-id" value="" />
+ <parameter name="ctotmp.action" value="create" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='validate-api-contrail-route-input' mode='sync' ></call>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="ctotmp.aai.source-network">
+ <parameter name="start[0]" value="`'/cloud-infrastructure/cloud-regions/cloud-region/' + $cto-api.cloud-owner + '/' + $cto-api.cloud-region-id`" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="`'/query/network-name-fromNetwork-role?networkRole=' + $cto-api.source-network-role`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create: Failed to get source network from aai" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create: Source network not found in AAI" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <for index='ctotmp.sidx' start='0' end='`$ctotmp.aai.source-network.results_length`' >
+ <block atomic="true">
+ <switch test='`$ctotmp.aai.source-network.results[$ctotmp.sidx].network-policy.network-policy-id`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$ctotmp.aai.source-network.results[$ctotmp.sidx].network-policy.network-policy-id`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="ctotmp.s-network-policy-list[$ctotmp.num-s-np].network-policy-id" value="`$ctotmp.aai.source-network.results[$ctotmp.sidx].network-policy.network-policy-id`" />
+ </set>
+ <set>
+ <parameter name="ctotmp.num-s-np" value="`$ctotmp.num-s-np+1`" />
+ </set>
+ <set>
+ <parameter name="ctotmp.s-network-policy-list_length" value="`$ctotmp.num-s-np`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$ctotmp.aai.source-network.results[$ctotmp.sidx].l3-network.network-id`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$ctotmp.aai.source-network.results[$ctotmp.sidx].l3-network.network-id`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="ctotmp.s-l3-network." value="`$ctotmp.aai.source-network.results[$ctotmp.sidx].l3-network.`" />
+ <parameter name="ctotmp.num-s-network" value="`$ctotmp.num-s-network+1`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$ctotmp.num-s-network`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create: Source network not found from aai" />
+ </return>
+ </outcome>
+ <outcome value='1'>
+ <set>
+ <parameter name="ctotmp.source-network.network-id" value="`$ctotmp.s-l3-network.network-id`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create: Too many networks returned for source network from aai" />
+ </return>
+ </outcome>
+ </switch>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="ctotmp.aai.collector-network">
+ <parameter name="start[0]" value="`'/cloud-infrastructure/cloud-regions/cloud-region/' + $cto-api.cloud-owner + '/' + $cto-api.cloud-region-id`" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="`'/query/network-name-fromNetwork-role?networkRole=' + $cto-api.collector-network-role`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create: Failed to get collector network from aai" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create: Collector network not found in AAI" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <for index='ctotmp.cidx' start='0' end='`$ctotmp.aai.collector-network.results_length`' >
+ <block atomic="true">
+ <switch test='`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.network-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create: Collector network not found from aai" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.network-id`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="ctotmp.c-l3-network." value="`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.`" />
+ <parameter name="ctotmp.num-c-network" value="`$ctotmp.num-c-network+1`" />
+ </set>
+ <for index='ridx' start='0' end='`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.relationship-list.relationship_length`' >
+ <switch test='`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.relationship-list.relationship[$ridx].related-to`'>
+ <outcome value='service-instance'>
+ <block atomic="true">
+ <for index='rdidx' start='0' end='`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.relationship-list.relationship[$ridx].relationship-data_length`' >
+ <switch test='`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='service-instance.service-instance-id'>
+ <block atomic="true">
+ <set>
+ <parameter name="collector-service-instance-id" value="`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='network-policy'>
+ <block atomic="true">
+ <for index='rdidx' start='0' end='`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.relationship-list.relationship[$ridx].relationship-data_length`' >
+ <switch test='`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='network-policy.network-policy-id'>
+ <block atomic="true">
+ <set>
+ <parameter name="ctotmp.c-network-policy-list[$ctotmp.num-c-np].network-policy-id" value="`$ctotmp.aai.collector-network.results[$ctotmp.cidx].l3-network.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value`" />
+ </set>
+ <set>
+ <parameter name="ctotmp.num-c-np" value="`$ctotmp.num-c-np+1`" />
+ </set>
+ <set>
+ <parameter name="ctotmp.c-network-policy-list_length" value="`$ctotmp.num-c-np`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$ctotmp.num-c-network`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create: Collector network not found from aai" />
+ </return>
+ </outcome>
+ <outcome value='1'>
+ <set>
+ <parameter name="ctotmp.dest-network.network-id" value="`$ctotmp.c-l3-network.network-id`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create: Too many networks returned for collector network from aai" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='ctotmp.spidx' start='0' end='`$ctotmp.s-network-policy-list_length`' >
+ <for index='ctotmp.cpidx' start='0' end='`$ctotmp.c-network-policy-list_length`' >
+ <block atomic="true">
+ <switch test='`$ctotmp.s-network-policy-list[$ctotmp.spidx].network-policy-id == $ctotmp.c-network-policy-list[$ctotmp.cpidx].network-policy-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name="ctotmp.network-policy-id" value="`$ctotmp.s-network-policy-list[$ctotmp.spidx].network-policy-id`" />
+ <parameter name="ctotmp.existing-network-policy-found" value="true" />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </for>
+ <switch test='`$ctotmp.network-policy-id`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="existing policy - error" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='ar-request-information.source' value="SDNC" />
+ </set>
+ <set>
+ <parameter name='ar-contrail-route-request-input.source-network.network-role' value="`$cto-api.source-network-role`" />
+ <parameter name='ar-contrail-route-request-input.source-network.network-id' value="`$ctotmp.source-network.network-id`" />
+ <parameter name='ar-contrail-route-request-input.dest-network.network-role' value="`$cto-api.collector-network-role`" />
+ <parameter name='ar-contrail-route-request-input.dest-network.network-id' value="`$ctotmp.dest-network.network-id`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-allottedresource-id' mode='sync' ></call>
+ <set>
+ <parameter name='ar-identifiers.allotted-resource-id' value="`$tmp.return.generate-allottedresource-id.id`" />
+ <parameter name='ar-identifiers.allotted-resource-type' value="contrail-route" />
+ <parameter name='ar-identifiers.parent-service-instance-id' value="`$cto-api.parent-service-instance-id`" />
+ <parameter name='ar-identifiers.consuming-service-instance-id' value="`$cto-api.service-instance-id` " />
+ <parameter name="tmp.ar.allotted-resource-id" value="`$tmp.return.generate-allottedresource-id.id`" />
+ <parameter name='tmp.ar.allotted-resource-type' value="contrail-route" />
+ <parameter name='tmp.ar.parent-service-instance-id' value="`$cto-api.parent-service-instance-id`" />
+ <!-- <parameter name='tmp.ar.contrail-applied-service-instance-id' value='' /> -->
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/contrail-route-topology/'` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.parent-provided-resource`"/>
+ <parameter name="outputPath" value="tmp.parent-ar-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$cto-api.parent-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.network`"/>
+ <parameter name="outputPath" value="tmp.ar-parentnetwork-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$cto-api.parent-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'>
+ <outcome value='1'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error: Existing contrail route allotted resource" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <!--
+<parameter name='ar.allotted-resource-status.action' value="`$contrail-route-topology-operation-input.request-information.request-action` " /><parameter name='ar.allotted-resource-status.rpc-name' value="contrail-route-topology-operation" /><parameter name='ar.allotted-resource-status.rpc-action' value="`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` " /><parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$contrail-route-topology-operation-input.request-information.` " /><parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$contrail-route-topology-operation-input.sdnc-request-header.` " /><parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$contrail-route-topology-operation-input.service-information.` " /><parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$contrail-route-topology-operation-input.allotted-resource-information.` " /><parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.` " />
+-->
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.parent-ar-url`"/>
+ <parameter name="outputPath" value="tmp.parent-ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.network-provided-resource`"/>
+ <parameter name="outputPath" value="tmp.network-ar-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/>
+ </execute>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.ar-name' value='$source-network-name_$cloud-region-id_$source-network-role_$collector-network-role _policy_' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$source-network-name"/>
+ <parameter name="replacement" value="`$ctotmp.s-l3-network.network-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$cloud-region-id"/>
+ <parameter name="replacement" value="`$cto-api.cloud-region-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$source-network-role"/>
+ <parameter name="replacement" value="`$cto-api.source-network-role`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$collector-network-role"/>
+ <parameter name="replacement" value="`$cto-api.collector-network-role`"/>
+ </execute>
+ <set>
+ <parameter name='generate-unique-name-input.index-table-name' value='CONTRAIL_ROUTE_NAME_INDEX' />
+ <parameter name='generate-unique-name-input.index-table-prefix-column' value='contrail_route_name_prefix' />
+ <parameter name='generate-unique-name-input.name-table-type' value='CONTRAIL_ROUTE_INSTANCE' />
+ <parameter name='generate-unique-name-input.prefix' value="`$tmp.ar-name`" />
+ <parameter name='generate-unique-name-input.index-length' value='2' />
+ </set>
+ <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="tmp.ar-name="/>
+ <parameter name="field3" value="`$tmp.ar-name`"/>
+ <parameter name="field4" value="generate-unique-name-input.prefix" />
+ <parameter name="field5" value="`$generate-unique-name-input.prefix`" />
+ </record>
+ <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.ar-name' value='`$generate-unique-name-output.generated-name`' />
+ </set>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
+ </set>
+ </block>
+ <set>
+ <parameter name='ar.allotted-resource-data.contrail-route-topology.allotted-resource-identifiers.'
+value="`$ar-identifiers.`" />
+ </set>
+ <set>
+ <parameter name='ar-assignments.source-network.network-id' value="`$ctotmp.s-l3-network.network-id` " />
+ <parameter name='ar-assignments.source-network.network-role' value="`$cto-api.source-network-role` " />
+ <parameter name='ar-assignments.dest-network.network-id' value="`$ctotmp.c-l3-network.network-id` " />
+ <parameter name='ar-assignments.dest-network.network-role' value="`$cto-api.collector-network-role` " />
+ </set>
+ <set>
+ <parameter name='tmp.fq-name' value='$defaultDomain.$defaultProject.$sdncNetworkPolicy' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.fq-name`"/>
+ <parameter name="outputPath" value="tmp.fq-name"/>
+ <parameter name="target" value="$defaultDomain"/>
+ <parameter name="replacement" value="`$cto-api.default-domain`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.fq-name`"/>
+ <parameter name="outputPath" value="tmp.fq-name"/>
+ <parameter name="target" value="$defaultProject"/>
+ <parameter name="replacement" value="`$cto-api.default-project`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.fq-name`"/>
+ <parameter name="outputPath" value="tmp.fq-name"/>
+ <parameter name="target" value="$sdncNetworkPolicy"/>
+ <parameter name="replacement" value="`$tmp.ar-name`"/>
+ </execute>
+ <set>
+ <parameter name='ar-assignments.fq-name' value="`$tmp.fq-name` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Created' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <switch test='`$cto-api.isTest`'>
+ <outcome value=''>
+ <block atomic="true">
+ <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.api-contrail-route-topology-operation-create"/>
+ <parameter name='field3' value='network-policy' />
+ <parameter name='field4' value='create' />
+ <parameter name='field5' value='contrailResp' />
+ <parameter name='field6' value='`$cto-api.default-domain`' />
+ <parameter name='field7' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name`' />
+ <parameter name='field8' value='`$cto-api.default-project`' />
+ <parameter name='field9' value='`$ctotmp.c-l3-network.contrail-network-fqdn`' />
+ <parameter name='field10' value='`$ctotmp.s-l3-network.contrail-network-fqdn`' />
+ <parameter name='field11' value='&lt;&gt;' />
+ <parameter name='field12' value='`$cto-api.cloud-region-id`' />
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='create' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='policy-name' value='`$tmp.fq-name`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <!-- <parameter name='vipr-service-instance' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.contrail-applied-service.contrail-fqdn`' /> -->
+ <parameter name='dst-virtual-network' value='`$ctotmp.c-l3-network.contrail-network-fqdn`' />
+ <parameter name='src-virtual-network' value='`$ctotmp.s-l3-network.contrail-network-fqdn`' />
+ <parameter name='direction' value='&lt;&gt;' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name="contrail-created" value="true" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to create policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='ar-assignments.contrail-id' value="`$contrailResp.network-policy.uuid`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <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.api-contrail-route-topology-operation-create"/>
+ <parameter name='field3' value='network-policy' />
+ <parameter name='field4' value='TESTcreate' />
+ <parameter name='field5' value='contrailResp' />
+ <parameter name='field6' value='`$cto-api.default-domain`' />
+ <parameter name='field7' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name`' />
+ <parameter name='field8' value='`$cto-api.default-project`' />
+ <parameter name='field10' value='`$ctotmp.c-l3-network.contrail-network-fqdn`' />
+ <parameter name='field11' value='`$ctotmp.s-l3-network.contrail-network-fqdn`' />
+ <parameter name='field12' value='&lt;&gt;' />
+ <parameter name='field13' value='`$cto-api.cloud-region-id`' />
+ </record>
+ <set>
+ <parameter name='ar-assignments.contrail-id' value="dummy12345" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <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.api-contrail-route-topology-operation-create"/>
+ <parameter name='field3' value='network-policy' />
+ <parameter name='field4' value='create' />
+ <parameter name='field5' value='contrailResp' />
+ <parameter name='field6' value='`$cto-api.default-domain`' />
+ <parameter name='field7' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name`' />
+ <parameter name='field8' value='`$cto-api.default-project`' />
+ <parameter name='field9' value='`$ctotmp.c-l3-network.contrail-network-fqdn`' />
+ <parameter name='field10' value='`$ctotmp.s-l3-network.contrail-network-fqdn`' />
+ <parameter name='field11' value='&lt;&gt;' />
+ <parameter name='field12' value='`$cto-api.cloud-region-id`' />
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='create' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='policy-name' value='`$tmp.fq-name`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <!-- <parameter name='vipr-service-instance' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.contrail-applied-service.contrail-fqdn`' /> -->
+ <parameter name='dst-virtual-network' value='`$ctotmp.c-l3-network.contrail-network-fqdn`' />
+ <parameter name='src-virtual-network' value='`$ctotmp.s-l3-network.contrail-network-fqdn`' />
+ <parameter name='direction' value='&lt;&gt;' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name="contrail-created" value="true" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to create policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='ar-assignments.contrail-id' value="`$contrailResp.network-policy.uuid`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.'
+value="`$ar-assignments.`" />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <!-- Create network-policy object -->
+ <parameter name="network-policy-id" value="`$ar-assignments.contrail-id`" />
+ <parameter name="network-policy-fqdn" value="`$ar-assignments.fq-name`" />
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name="np-aai-created" value="" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Failed to save network-policy in AAI"/>
+ </set>
+ <block>
+ <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="ROLLING BACK the create due to error"/>
+ </record>
+ <switch test='`$np-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'></outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='failure'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id">
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error creating contrail route - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Failed to save network-policy in AAI"/>
+ </set>
+ <block>
+ <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="ROLLING BACK the create due to error"/>
+ </record>
+ <switch test='`$np-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'></outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='failure'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id">
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error creating contrail route - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $cto-api.service-type AND
+ service-instance.service-instance-id = $cto-api.parent-service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="id" value="`$tmp.ar.allotted-resource-id`" />
+ <parameter name="description" value="`$tmp.ar.allotted-resource-type`" />
+ <parameter name="selflink" value="`$tmp.ar.self-link`" />
+ <parameter name="operational-status" value="out-of-service-path" />
+ <parameter name="order-status" value="Created" />
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name="ar-aai-created" value="" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Failed to save allotted resource in AAI"/>
+ </set>
+ <block>
+ <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="ROLLING BACK the create due to error"/>
+ </record>
+ <switch test='`$np-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'></outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='failure'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id">
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error creating contrail route - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Failed to save allotted resource in AAI"/>
+ </set>
+ <block>
+ <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="ROLLING BACK the create due to error"/>
+ </record>
+ <switch test='`$np-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'></outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='failure'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id">
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error creating contrail route - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.cidx' value="`0`" />
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value="1" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='cidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' >
+ <switch test="`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].allotted-resource-id == $tmp.ar.allotted-resource-id`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.cidx' value='`$cidx`' />
+ <parameter name='ctx.consumed-ar.' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].`' />
+ <parameter name='tmp.found-cidx' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.found-cidx`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.cidx' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-type' value="`$tmp.ar.allotted-resource-type` " />
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-pointer' value="`$tmp.ar.self-link` " />
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value='`$tmp.cidx + 1`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="parent" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error updating md-sal for contrail-route-allotted-resource"/>
+ </set>
+ <block>
+ <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="ROLLING BACK the create due to error"/>
+ </record>
+ <switch test='`$np-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'></outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='failure'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id">
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error creating contrail route - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error updating md-sal for contrail-route-allotted-resource"/>
+ </set>
+ <block>
+ <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="ROLLING BACK the create due to error"/>
+ </record>
+ <switch test='`$np-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'></outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='failure'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id">
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error creating contrail route - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name="ar-created" value="true" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="parent" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ <block>
+ <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="ROLLING BACK the create due to error"/>
+ </record>
+ <switch test='`$np-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'></outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='failure'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id">
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error creating contrail route - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="parent" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ <block>
+ <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="ROLLING BACK the create due to error"/>
+ </record>
+ <switch test='`$np-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'></outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='failure'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-aai-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id">
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </delete>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-created`'>
+ <outcome value=''></outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='failure'></outcome>
+ <outcome value='not-found'></outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error creating contrail route - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='cto-api.contrail-route-allotted-instance-id' value='`$tmp.ar.allotted-resource-id`' />
+ </set>
+ <set>
+ <parameter name='ctotmp.' value='' />
+ </set>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-deactivate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-deactivate.xml
new file mode 100644
index 00000000..c49f2ebe
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-deactivate.xml
@@ -0,0 +1,618 @@
+<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='api-contrail-route-topology-operation-deactivate' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-api-contrail-route-input' mode='sync' ></call>
+ <set>
+ <parameter name='tmp.ar.allotted-resource-id' value='`$cto-api.contrail-route-allotted-resource-id`' />
+ <parameter name='tmp.ar.parent-service-instance-id' value='`$cto-api.parent-service-instance-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/contrail-route-topology/'` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name='bk-cr-ar' value='$mdsal-ar.' />
+ </set>
+ <set>
+ <parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' />
+ </set>
+ <switch test='`$ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+ <outcome value='Active'>
+ <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="`'Existing contrail-route-allotted-resource with order status of ' + $ar.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Contrail Route not found" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Contrail Route not found" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='ar-assignments.' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.`" />
+ </set>
+ <switch test='`$ar-assignments.source-network.network-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error activating contrail route. Source network not found" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </switch>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $ar-assignments.source-network.network-id"
+ local-only="false"
+ pfx="aai.src-network">
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar-assignments.source-network.network-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar-assignments.source-network.network-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='virtual-network-fqdn-split' />
+ <parameter name='original_string' value='`$aai.src-network.contrail-network-fqdn`' />
+ <parameter name='regex' value=':' />
+ </execute>
+ <switch test='`$virtual-network-fqdn-split_length`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Unable to determine network fq-name from contrail fqdn' />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='src-virtual-network-fqname' value='`$virtual-network-fqdn-split[$virtual-network-fqdn-split_length - 1]`' />
+ </set>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='fqname-to-uuid' />
+ <parameter name='api-action' value='get' />
+ <parameter name='resp-prefix' value='uuidresp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='fqname-type' value='virtual-network' />
+ <parameter name='policy-name' value='`$src-virtual-network-fqname`' />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to find network uuid for Contrail to source network" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='src-uuid' value='`$uuidresp.uuid`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$uuidresp.uuid`' />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to remove policy in Contrail from source network" />
+ </return>
+ </outcome>
+ </execute>
+ <switch test='`$ar-assignments.dest-network.network-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error activating contrail route. Dest network not found" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </switch>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $ar-assignments.dest-network.network-id"
+ local-only="false"
+ pfx="aai.dest-network">
+ <outcome value='not-found'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$src-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$src-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ </get-resource>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='virtual-network-fqdn-split' />
+ <parameter name='original_string' value='`$aai.dest-network.contrail-network-fqdn`' />
+ <parameter name='regex' value=':' />
+ </execute>
+ <switch test='`$virtual-network-fqdn-split_length`'>
+ <outcome value='0'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$src-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Unable to determine network fq-name from contrail fqdn' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='dest-virtual-network-fqname' value='`$virtual-network-fqdn-split[$virtual-network-fqdn-split_length - 1]`' />
+ <parameter name='dest-default-project' value='`$virtual-network-fqdn-split[$virtual-network-fqdn-split_length - 2]`' />
+ </set>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='fqname-to-uuid' />
+ <parameter name='api-action' value='get' />
+ <parameter name='resp-prefix' value='uuidresp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$dest-default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='fqname-type' value='virtual-network' />
+ <parameter name='policy-name' value='`$dest-virtual-network-fqname`' />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$src-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to find network uuid for Contrail to destination network" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='dest-uuid' value='`$uuidresp.uuid`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$uuidresp.uuid`' />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$src-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to remove policy in Contrail from dest network" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy:relationship-list"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id and related-to = 'l3-network' " >
+ <outcome value='failure'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$src-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to save network policy in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$src-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to save network policy in AAI" />
+ </return>
+ </block>
+ </outcome>
+ </delete>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $ar.allotted-resource-data.contrail-route-topology.allotted-resource-identifiers.parent-service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="operational-status" value="out-of-service-path" />
+ <parameter name="orchestration-status" value="deactivated" />
+ <outcome value='failure'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$src-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$src-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </return>
+ </block>
+ </outcome>
+ </update>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$src-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$src-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$dest-uuid`' />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource" />
+ </return>
+ </block>
+ </outcome>
+ </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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-delete.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-delete.xml
new file mode 100644
index 00000000..f0dacbed
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_api-contrail-route-topology-operation-delete.xml
@@ -0,0 +1,332 @@
+<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='api-contrail-route-topology-operation-delete' mode='sync'>
+ <block atomic="true">
+ <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.api-contrail-route-topology-operation-delete"/>
+ <parameter name='field3' value='cto-api.parent-service-instance-id' />
+ <parameter name='field4' value='`$cto-api.parent-service-instance-id`' />
+ <parameter name='field5' value='cto-api.default-domain' />
+ <parameter name='field6' value='`$cto-api.default-domain`' />
+ <parameter name='field7' value='cto-api.port-mirror-configuration-instance-id' />
+ <parameter name='field8' value='`$cto-api.port-mirror-configuration-instance-id`' />
+ <parameter name='field9' value='cto-api.service-type' />
+ <parameter name='field10' value='`$cto-api.service-type`' />
+ <parameter name='field11' value='cto-api.source-network-role' />
+ <parameter name='field12' value='`$cto-api.source-network-fole`' />
+ <parameter name='field13' value='cto-api.collector-network-role' />
+ <parameter name='field14' value='`$cto-api.collector-network-4ole`' />
+ <parameter name='field15' value='cto-api.default-project' />
+ <parameter name='field16' value='`$cto-api.default-project`' />
+ <parameter name='field17' value='cto-api.cloud-region-id' />
+ <parameter name='field18' value='`$cto-api.cloud-region-id`' />
+ <parameter name='field19' value='cto-api.cloud-owner' />
+ <parameter name='field20' value='`$cto-api.cloud-owner`' />
+ <parameter name='field21' value='cto-api.isTest' />
+ <parameter name='field22' value='`$cto-api.isTest`' />
+ <parameter name='field23' value='service-data.service-information.global-customer-id' />
+ <parameter name='field24' value='`$service-data.service-information.global-customer-id`' />
+ </record>
+ <set>
+ <parameter name="ctotmp." value="" />
+ </set>
+ <set>
+ <parameter name="ctotmp.action" value="delete" />
+ <parameter name="ctotmp.config-count" value="0" />
+ <parameter name="ctotmp.config-found" value="true" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='validate-api-contrail-route-input' mode='sync' ></call>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id"
+ pfx='aai.ar' local-only='false' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <switch test='`$cto-api.rollback-flag`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <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>
+ </outcome>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true"></block>
+ </outcome>
+ </get-resource>
+ <for silentFailure='true' index='ridx' start='0' end="`$aai.ar.relationship-list.relationship_length`" >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$aai.ar.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='configuration.configuration-id'>
+ <block atomic="true">
+ <set>
+ <parameter name='ctotmp.config-count' value='`$ctotmp.config-count+1`' />
+ </set>
+ <switch test='`$aai.ar.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value == $cto-api.configuration-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='ctotmp.config-found' value='true' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <switch test="`$ctotmp.config-count > 1`">
+ <outcome value='true'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI Allotted Resource is tied to more than one configuration object" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$ctotmp.config-count == 1 and $ctotmp.config-found == 'true'`">
+ <outcome value='false'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI Allotted resource is not tied to configuration object" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block atomic="true"></block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$cto-api.contrail-route-allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name='bk-cr-ar' value='$mdsal-ar.' />
+ </set>
+ <set>
+ <parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Contrail Route not found in md-sal" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Contrail Route not found in md-sal" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='ar-assignments.' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$cto-api.cloud-region-id`' />
+ <parameter name='default-project' value='`$cto-api.default-project`' />
+ <parameter name='default-domain' value='`$cto-api.default-domain`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to create policy in Contrail" />
+ </return>
+ </outcome>
+ </execute>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to save network policy in AAI" />
+ </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="Failed to save network policy in AAI" />
+ </return>
+ </outcome>
+ </delete>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $cto-api.contrail-route-allotted-resource-id">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </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="AAI failed" />
+ </return>
+ </outcome>
+ </delete>
+ <for silentFailure='true' index='snidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' >
+ <block atomic="true">
+ <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource[$sdix].allotted-resource-id == $cto-api.contrail-route-allotted-resource-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.sdidx" value="`$snidx`"/>
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic="true">
+ <set>
+ <parameter name="service-data.consumed-allotted-resources." value=""/>
+ </set>
+ <set>
+ <parameter name="service-data.consumed-allotted-resources.consumed-allotted-resource_length" value="0"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.new_length" value="`$service-data.consumed-allotted-resources.consumed-allotted-resource_length - 1`"/>
+ </set>
+ <for silentFailure='true' index='snidx' start='`$tmp.sdidx + 1`' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.newidx" value="`$snidx - 1`"/>
+ </set>
+ <set>
+ <parameter name="service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.newidx]." value="$service-data.consumed-allotted-resources.consumed-allotted-resource[$snidx]." />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name="service-data.consumed-allotted-resources.consumed-allotted-resource_length" value="`$service-data.consumed-allotted-resources.consumed-allotted-resource_length - 1`"/>
+ </set>
+ <set>
+ <parameter name="service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.new_length]." value=""/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block></block>
+ </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 updating md-sal for contrail-route-allotted-resource" />
+ </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="Error updating md-sal for contrail-route-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+ <parameter name='contrail-route-object-path' value="`$tmp.ar.self-link`"/>
+ <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $contrail-route-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_assign-vlan-tags.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_assign-vlan-tags.xml
new file mode 100755
index 00000000..f23891cf
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_assign-vlan-tags.xml
@@ -0,0 +1,441 @@
+<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='assign-vlan-tags' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vlan-vnics.' value='' />
+ </set>
+ <set>
+ <parameter name='tmp.vlan-vnics.'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].vlan-vnics.`' />
+ </set>
+ <set>
+ <parameter name='total-subs' value='`$get-data-from-policy-output.precreate-sub-intf-num`' />
+ </set>
+ <switch test='`$total-subs &gt; ( $tmp.vlan-vnics.vlan-vnic_length * $get-data-from-policy-output.max-num-sub-intf )`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='total-subs' value='`$tmp.vlan-vnics.vlan-vnic_length * $get-data-from-policy-output.max-num-sub-intf`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='cur-tag-id' value='`$get-data-from-policy-output.vlan-tag-start + $get-data-from-policy-output.vlan-tag-offset`' />
+ </set>
+ <set>
+ <parameter name='sub-index' value='0' />
+ <parameter name='vnic-index' value='0' />
+ </set>
+ <while test='`$total-subs &gt; 0`'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].vlan-tag-id'
+ value='`$cur-tag-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data_length'
+ value='`$sub-index + 1`' />
+ </set>
+ <set>
+ <parameter name='cur-tag-id' value='`$cur-tag-id + 1`' />
+ </set>
+ <set>
+ <parameter name='vnic-index' value='`$vnic-index + 1`' />
+ </set>
+ <switch test='`$vnic-index == $tmp.vlan-vnics.vlan-vnic_length`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vnic-index' value='0' />
+ </set>
+ <set>
+ <parameter name='sub-index' value='`$sub-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='total-subs' value='`$total-subs - 1`' />
+ </set>
+ </block>
+ </while>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="instance-groups"
+ key="instance-group.instance-group-function = $db.group-uuids[$group-index].network-collection-function
+ AND instance-group.instance-group-type = 'L3-NETWORK'"
+ pfx='aai.instance-group' 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="`'Unable to find AAI instance-group for instance-group-function '
+ + $db.group-uuids[$group-index].network-collection-function
+ + ' and instance-group-type L3-NETWORK'`" />
+ </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="`'System error getting AAI instance-group for instance-group-function '
+ + $db.group-uuids[$group-index].network-collection-function
+ + ' and instance-group-type L3-NETWORK'`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='found-instance-group' value='false' />
+ </set>
+ <for index='ig-index' start='0' end='`$aai.instance-group.instance-group_length`' >
+ <for index='rel-index' start='0' end='`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship_length`' >
+ <for index='reldata-index' start='0' end='`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship[$rel-index].relationship-data_length`' >
+ <switch test="`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship[$rel-index].relationship-data[$reldata-index].relationship-key
+ == 'service-instance.service-instance-id'`">
+ <outcome value='true'>
+ <switch test='`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship[$rel-index].relationship-data[$reldata-index].relationship-value
+ == $service-data.service-information.service-instance-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-instance-group' value='true' />
+ </set>
+ <set>
+ <parameter name='aai-ig-index' value='`$ig-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </for>
+ <switch test='`$found-instance-group`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Unable to find AAI instance-group for instance-group-function '
+ + $db.group-uuids[$group-index].vfc-instance-group-function
+ + ' and instance-group-type VNFC'`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='network-instance-group-id' value='`$aai.instance-group.instance-group[$aai-ig-index].id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id'
+ value='`$aai.instance-group.instance-group[$aai-ig-index].id`' />
+ </set>
+ <set>
+ <parameter name='network-instance-group-index' value='-1' />
+ </set>
+ <for silentFailure='true' index='nig-index' start='0' end='`$service-data.network-instance-groups.network-instance-group_length`' >
+ <switch test='`$network-instance-group-id
+== $service-data.network-instance-groups.network-instance-group[$nig-index].network-instance-group-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='network-instance-group-index' value='`$nig-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$network-instance-group-index`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Unable to find network instance group ID '
+ + $network-instance-group-id
+ + ' in network-instance-groups'`" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='vnic-index' start='0' end='`$tmp.vlan-vnics.vlan-vnic_length`' >
+ <for index='sub-index' start='0' end='`$tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='network-index' value='-1' />
+ <parameter name='unassigned-network-index' value='-1' />
+ </set>
+ <for index='n-index' start='0' end='`$service-data.network-instance-groups.network-instance-group[$network-instance-group-index].networks.network_length`' >
+ <switch test='`$tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].vlan-tag-id
+ == $service-data.network-instance-groups.network-instance-group[$network-instance-group-index].networks.network[$n-index].vlan-tag-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='network-index' value='`$n-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <switch test="`$unassigned-network-index`">
+ <outcome value='-1'>
+ <switch test='`$service-data.network-instance-groups.network-instance-group[$network-instance-group-index].networks.network[$n-index].network-status`'>
+ <outcome value='unassigned'>
+ <set>
+ <parameter name='unassigned-network-index' value='`$n-index`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$network-index`'>
+ <outcome value='-1'>
+ <switch test='`$unassigned-network-index`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="L3-network not found" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-id'
+ value='`$service-data.network-instance-groups.network-instance-group[$network-instance-group-index].networks.network[$unassigned-network-index].network-id`' />
+ </set>
+ <set>
+ <parameter name='service-data.network-instance-groups.network-instance-group[$network-instance-group-index].networks.network[$unassigned-network-index].vlan-tag-id'
+ value='`$tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].vlan-tag-id`' />
+ <parameter name='service-data.network-instance-groups.network-instance-group[$network-instance-group-index].networks.network[$unassigned-network-index].network-status'
+ value='assigned' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-id'
+ value='`$service-data.network-instance-groups.network-instance-group[$network-instance-group-index].networks.network[$network-index].network-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </for>
+ <for index='vnic-index' start='0' end='`$tmp.vlan-vnics.vlan-vnic_length`' >
+ <for index='sub-index' start='0' end='`$tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data_length`' >
+ <block atomic="true">
+ <for index='n-index' start='0' end='`$service-data.networks.network_length`' >
+ <switch test='`$tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-id
+ == $service-data.networks.network[$n-index].network-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-name'
+ value='`$service-data.networks.network[$n-index].network-data.network-topology.network-topology-identifier-structure.network-name`' />
+ <parameter name='tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-role'
+ value='`$service-data.networks.network[$n-index].network-data.network-topology.network-topology-identifier-structure.network-role`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </for>
+ <switch test='`$tmp.vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-name`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to find a network name for network id '
+ + $service-data.networks.network[$n-index].network-id`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='found-collection' value='false' />
+ </set>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$idx].network-instance-group-function
+ == $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-function`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-collection' value='true' />
+ </set>
+ <set>
+ <parameter name='vnc-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-collection`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Unable to find vnf-network-collection for network-instance-group-function '
+ + $tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].network-instance-group-function`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='found-network-instance-group' value='false' />
+ </set>
+ <for index='idx' start='0' end='`$service-data.network-instance-groups.network-instance-group_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id
+ == $service-data.network-instance-groups.network-instance-group[$idx].network-instance-group-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-network-instance-group' value='true' />
+ </set>
+ <set>
+ <parameter name='nig-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-network-instance-group`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Unable to find network-instance-group for network-instance-group-id '
+ + $tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].network-instance-group-id`" />
+ </return>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='subnet-index' start='0'
+ end='`$service-data.network-instance-groups.network-instance-group[$nig-index].subnets_length`' >
+ <switch test='`$service-data.network-instance-groups.network-instance-group[$nig-index].subnets[$subnet-index].ip-version`'>
+ <outcome value='ipv4'>
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$vnc-index].vnf-floating-ip.ip-addresses.vipv4-address`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='tmp.vt-ip.network-instance-group-id'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].network-instance-group-id`' />
+ <parameter name='tmp.vt-ip.network-instance-group-function'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].network-instance-group-function`' />
+ <parameter name='tmp.vt-ip.nf-role'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-role`' />
+ <parameter name='tmp.vt-ip.vm-type'
+ value='`$db.group-uuids[$group-index].vm-type`' />
+ <parameter name='tmp.vt-ip.vnfc-name'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnfc-name`' />
+ <parameter name='tmp.vt-ip.type'
+ value='VIP' />
+ <parameter name='tmp.vt-ip.vf-module-id'
+ value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='tmp.vt-ip.ip-version'
+ value='ipv4' />
+ <parameter name='tmp.vt-ip.network-id'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[0].vnic-sub-interface.sub-interface-network-data[0].network-id`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-vlan-tagging-ip-addresses' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans_length' value='2' />
+ <parameter name='eipam-ip-block.plans[0].plan-name' value='plan-1' />
+ <parameter name='eipam-ip-block.plans[0].requests_length' value='1' />
+ <parameter name='eipam-ip-block.plans[0].requests[0].client-key'
+ value='vm-type-1|zmtn6nf-code-16code-1001|network-role-1|subnet-role-1|FIXED|4|1' />
+ <parameter name='eipam-ip-block.plans[0].requests[0].ip-type' value='FIXED' />
+ <parameter name='eipam-ip-block.plans[0].requests[0].ip-prefix' value="`'34.52.87.1' + $counter`" />
+ <parameter name='eipam-ip-block.plans[0].requests[0].ip-version' value='4' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$vnc-index].vnf-floating-ip.ip-addresses.vipv4-address'
+ value='`$eipam-ip-block.plans[0].requests[0].ip-prefix`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <for index='vlan-vnic-index' start='0' end='`$tmp.vlan-vnics.vlan-vnic_length`' >
+ <for index='sub-index' start='0' end='`$tmp.vlan-vnics.vlan-vnic[$vlan-vnic-index].vnic-sub-interfaces.sub-interface-network-data_length`' >
+ <set>
+ <parameter name='tmp.vlan-vnics.vlan-vnic[$vlan-vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].floating-ips.floating-ip-v4'
+ value='`$eipam-ip-block.plans[0].requests[0].ip-prefix`' />
+ </set>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='ipv6'>
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$vnc-index].vnf-floating-ip.ip-addresses.vipv6-address`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='tmp.vt-ip.network-instance-group-id'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].network-instance-group-id`' />
+ <parameter name='tmp.vt-ip.network-instance-group-function'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].network-instance-group-function`' />
+ <parameter name='tmp.vt-ip.nf-role'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-role`' />
+ <parameter name='tmp.vt-ip.vm-type'
+ value='`$db.group-uuids[$group-index].vm-type`' />
+ <parameter name='tmp.vt-ip.vnfc-name'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnfc-name`' />
+ <parameter name='tmp.vt-ip.type'
+ value='VIP' />
+ <parameter name='tmp.vt-ip.vf-module-id'
+ value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='tmp.vt-ip.ip-version'
+ value='ipv6' />
+ <parameter name='tmp.vt-ip.network-id'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[0].vnic-sub-interface.sub-interface-network-data[0].network-id`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-vlan-tagging-ip-addresses' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans_length' value='2' />
+ <parameter name='eipam-ip-block.plans[0].plan-name' value='plan-1' />
+ <parameter name='eipam-ip-block.plans[0].requests_length' value='6' />
+ <parameter name='eipam-ip-block.plans[0].requests[0].client-key'
+ value='vm-type-1|zmtn6nf-code-16code-1001|network-role-1|subnet-role-1|FIXED|4|1' />
+ <parameter name='eipam-ip-block.plans[0].requests[0].ip-type' value='FIXED' />
+ <parameter name='eipam-ip-block.plans[0].requests[0].ip-prefix' value="`'cafe:1111' + $counter`" />
+ <parameter name='eipam-ip-block.plans[0].requests[0].ip-version' value='6' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$vnc-index].vnf-floating-ip.ip-addresses.vipv6-address'
+ value='`$eipam-ip-block.plans[0].requests[0].ip-prefix`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <for index='vlan-vnic-index' start='0' end='`$tmp.vlan-vnics.vlan-vnic_length`' >
+ <for index='sub-index' start='0' end='`$tmp.vlan-vnics.vlan-vnic[$vlan-vnic-index].vnic-sub-interfaces.sub-interface-network-data_length`' >
+ <set>
+ <parameter name='tmp.vlan-vnics.vlan-vnic[$vlan-vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].floating-ips.floating-ip-v6'
+ value='`$eipam-ip-block.plans[0].requests[0].ip-prefix`' />
+ </set>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].vlan-vnics.'
+ value='`$tmp.vlan-vnics.`' />
+ </set>
+ <return status='success'></return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_auto-ip-assignment.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_auto-ip-assignment.xml
new file mode 100644
index 00000000..77fdb44d
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_auto-ip-assignment.xml
@@ -0,0 +1,1593 @@
+<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='auto-ip-assignment' mode='sync'>
+ <block atomic="true">
+ <switch test='`$auto-ip-assignment-input.aic-cloud-region`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="auto-ip-assignment-input.aic-cloud-region is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$auto-ip-assignment-input.vf-module.model-customization-uuid`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="auto-ip-assignment-input.vf-module.model-customization-uuid is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$auto-ip-assignment-input.vf-module-id`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="auto-ip-assignment-input.vf-module-id is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$auto-ip-assignment-input.service-instance-id`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="auto-ip-assignment-input.service-instance-id is null" />
+ </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 = $auto-ip-assignment-input.vf-module.model-customization-uuid'
+ pfx='db1.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="404" />
+ <parameter name="error-message" value="`'No model found for VF module customization UUID ' + $vnf-topology-operation-input.vnf-request-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <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 = $auto-ip-assignment-input.vf-module.model-customization-uuid
+ AND vm_count > 0'
+ pfx='db1.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='db1.vf-module-to-vfc-mapping_length' value='0' />
+ </set>
+ </outcome>
+ </get-resource>
+ <block atomic='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cloud-region"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $auto-ip-assignment-input.aic-cloud-region AND
+ depth = '0'"
+ pfx='aai.cloud-region' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'aic-cloud-region, '+ $generate-fqpn-input.aic-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>
+ <switch test='`$aai.cloud-region.relationship-list.relationship_length`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="cloud-region missing relationships in AAI" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="cloud-region missing relationships in AAI" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='ridx' start='0' end='`$aai.cloud-region.relationship-list.relationship_length`' >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='complex.physical-location-id'>
+ <block atomic='true'>
+ <block>
+ <set>
+ <parameter name='tmp.aic-clli' value='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring'>
+ <parameter name='result' value='tmp.truncated.clli8' />
+ <parameter name='string' value='`$tmp.aic-clli`' />
+ <parameter name='begin-index' value='0' />
+ <parameter name='end-index' value='8' />
+ </execute>
+ <set>
+ <parameter name='generate-FQPN-input.location-clli8' value='`$tmp.truncated.clli8`' />
+ </set>
+ </block>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="complex"
+ key="complex.physical-location-id = $aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.complex' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Complex 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 complex from AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='generate-FQPN-input.complex-region' value='`$aai.complex.region`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <set>
+ <parameter name='generate-FQPN-input.aic-cloud-region'
+ value='`$auto-ip-assignment-input.aic-cloud-region`' />
+ </set>
+ </block>
+ <set>
+ <parameter name='tmp.network-role-query-results_length' value='0' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans_length' value = '0' />
+ <parameter name='query-aai-l3-network-by-network-role-output.' value = '' />
+ </set>
+ <set>
+ <parameter name='qridx' value = '0' />
+ </set>
+ <set>
+ <parameter name='pidx' value = '0' />
+ </set>
+ <for index='vm-type-index' start='0' end='`$db1.vf-module-to-vfc-mapping_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='vm-type-loop' value = 'START' />
+ <parameter name='tmp.vm-type' value = '`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ </set>
+ <set>
+ <parameter name='tmp.db1.' value = '' />
+ </set>
+ <set>
+ <parameter name='db1.vfc-to-network-role-mapping.' value = '' />
+ </set>
+ <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 = $db1.vf-module-to-vfc-mapping[$vm-type-index].vfc-customization-uuid
+ AND (ipv4_count > 0 OR ipv6_count > 0 OR ipv4_floating_count > 0 OR ipv6_floating_count > 0)'
+ pfx='db1.vfc-to-network-role-mapping[]'>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='db1.vfc-to-network-role-mapping_length' value='0' />
+ </set>
+ </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 reading VFC_TO_NETWORK_ROLE_MAPPING table" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.qresult.network-role' value = '`$tmp.network-role-query-results[$q].l3-network.network-role`' />
+ </set>
+ <for index='network-role-index' start='0' end='`$db1.vfc-to-network-role-mapping_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='network-role-loop' value = 'START' />
+ </set>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='false' />
+ </set>
+ <set>
+ <parameter name='tmp.network-role.found' value = 'false' />
+ </set>
+ <set>
+ <parameter name='tmp.db1.network-role' value = '`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.db1.network-role-tag' value = '`$db1.vfc-to-network-role-mapping[$network-role-index].network-role-tag`' />
+ </set>
+ <block atomic='true'>
+ <block>
+ <for index='q' start='0' end='`$tmp.network-role-query-results_length`' >
+ <set>
+ <parameter name='tmp.qresult.network-role' value = '`$tmp.network-role-query-results[$q].l3-network.network-role`' />
+ </set>
+ <switch test='`$tmp.qresult.network-role == $tmp.db1.network-role`' >
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.network-name'
+ value='`$tmp.network-role-query-results[$q].l3-network.network-name`' />
+ <parameter name='generate-FQPN-input.network-id'
+ value='`$tmp.network-role-query-results[$q].l3-network.network-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.network-role.found' value = 'true' />
+ </set>
+ <set>
+ <parameter name='query-results-found-index' value = '`$q`' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <return status='success'></return>
+ </block>
+ <switch test='`$tmp.network-role.found`'>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='query-aai-l3-network-by-network-role-input.aic-cloud-region'
+ value='`$auto-ip-assignment-input.aic-cloud-region`' />
+ <parameter name='query-aai-l3-network-by-network-role-input.service-instance-id'
+ value='`$auto-ip-assignment-input.service-instance-id`' />
+ <parameter name='query-aai-l3-network-by-network-role-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <!--
+filter options: service-instance-id, aic-cloud-region, null, Other (or any string)
+ - null or Other will filter by aic-cloud-region first, then service-instance-id
+<parameter name='query-aai-l3-network-by-network-role-input.filter'
+ value='service-instance-id' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='query-aai-l3-network-by-network-role' 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="`'An error occured while querying AAI to retrieve l3-network by network-role: ' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='generate-FQPN-input.network-name'
+ value='`$query-aai-l3-network-by-network-role-output.l3-network.network-name`' />
+ <parameter name='generate-FQPN-input.network-id'
+ value='`$query-aai-l3-network-by-network-role-output.l3-network.network-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.network-role-query-results[$qridx].l3-network.'
+ value='`$query-aai-l3-network-by-network-role-output.l3-network.`' />
+ <parameter name='tmp.network-role-query-results[$qridx].l3-network.network-role-tag'
+ value='`$tmp.db1.network-role-tag`' />
+ <!--
+<parameter name='tmp.network-role-query-results[$qridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' /><parameter name='tmp.network-role-query-results[$qridx].network-name'
+ value='`$query-aai-l3-network-by-network-role-output.l3-network.network-name`' />
+-->
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].l3-network.'
+ value='query-aai-l3-network-by-network-role-output.l3-network.' />
+ </set>
+ <set>
+ <parameter name='qridx' value='`$qridx + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.network-role-query-results_length' value='`$qridx`' />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='ridx' value='0' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].subnet-role'
+ value="`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`" />
+ </set>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`'>
+ <outcome value='4'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-use-dhcp`'>
+ <outcome value='N'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-count &gt; 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-address-plan-name`' />
+ <parameter name='generate-FQPN-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='generate-FQPN-input.subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='generate-FQPN-input.vrf-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-vrf-name`' />
+ <!--
+<parameter name='generate-FQPN-input.plans-index' value='`$pidx`' /><parameter name='generate-FQPN-input.requests-index' value='`$ridx`' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' 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="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-address-plan-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].address-family'
+ value="`'ipv' + $db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`" />
+ </set>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='true' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='0' />
+ </set>
+ <for index='vm-index' start='0' end='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' >
+ <for index='ipv4-index' start='0' end='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-count`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-version'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].use-dhcp'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-use-dhcp`' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='`$tmp.client-key.seq + 1`' />
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].'
+ value='generate-FQPN-output.' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vm-type'
+ value='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-type'
+ value='FIXED' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ </set>
+ <block>
+ <switch test='`$tmp.client-key.seq &lt; 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='000' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq &lt; 100`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='00' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq &lt; 1000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='0' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq &lt; 10000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].client-key'
+ value="`$eipam-ip-block.plans[$pidx].requests[$ridx].vm-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].network-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-version + '|' +
+ $tmp.client-key.padding + $tmp.client-key.seq`"/>
+ <!-- rdn|zrdm3amdns02testdns001|data|static|VIP|4|0001 -->
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].info'
+ value='`$auto-ip-assignment-input.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='ridx' value='`$ridx + 1`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests_length' value='`$ridx`' />
+ </set>
+ </block>
+ </block>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`'>
+ <outcome value='6'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-use-dhcp`'>
+ <outcome value='N'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-count &gt; 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-address-plan-name`' />
+ <parameter name='generate-FQPN-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='generate-FQPN-input.subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='generate-FQPN-input.vrf-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-vrf-name`' />
+ <!--
+<parameter name='generate-FQPN-input.plans-index' value='`$pidx`' /><parameter name='generate-FQPN-input.requests-index' value='`$ridx`' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' 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="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-address-plan-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].address-family'
+ value="`'ipv' + $db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`" />
+ </set>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='true' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='0' />
+ </set>
+ <for index='vm-index' start='0' end='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' >
+ <for index='ipv6-index' start='0' end='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-count`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-version'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].use-dhcp'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-use-dhcp`' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='`$tmp.client-key.seq + 1`' />
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].'
+ value='generate-FQPN-output.' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vm-type'
+ value='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-type'
+ value='FIXED' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ </set>
+ <block>
+ <switch test='`$tmp.client-key.seq &lt; 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='000' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq &lt; 100`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='00' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq &lt; 1000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='0' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq &lt; 10000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].client-key'
+ value="`$eipam-ip-block.plans[$pidx].requests[$ridx].vm-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].network-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-version + '|' +
+ $tmp.client-key.padding + $tmp.client-key.seq`"/>
+ <!-- rdn|zrdm3amdns02testdns001|data|static|VIP|4|0001 -->
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].info'
+ value='`$auto-ip-assignment-input.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='ridx' value='`$ridx + 1`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests_length' value='`$ridx`' />
+ </set>
+ </block>
+ </block>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.plan-index-to-be-incremented`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='pidx' value='`$pidx + 1`' />
+ </set>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$pidx`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].l3-network.'
+ value='tmp.network-role-query-results[$query-results-found-index].l3-network.' />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='ridx' value='0' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].subnet-role'
+ value="`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`" />
+ </set>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`'>
+ <outcome value='4'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-use-dhcp`'>
+ <outcome value='N'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-count &gt; 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-address-plan-name`' />
+ <parameter name='generate-FQPN-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='generate-FQPN-input.subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='generate-FQPN-input.vrf-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-vrf-name`' />
+ <!--
+<parameter name='generate-FQPN-input.plans-index' value='`$pidx`' /><parameter name='generate-FQPN-input.requests-index' value='`$ridx`' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' 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="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-address-plan-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].address-family'
+ value="`'ipv' + $db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`" />
+ </set>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='true' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='0' />
+ </set>
+ <for index='vm-index' start='0' end='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' >
+ <for index='ipv4-index' start='0' end='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-count`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-version'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].use-dhcp'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-use-dhcp`' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='`$tmp.client-key.seq + 1`' />
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].'
+ value='generate-FQPN-output.' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vm-type'
+ value='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-type'
+ value='FIXED' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ </set>
+ <block>
+ <switch test='`$tmp.client-key.seq &lt; 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='000' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq &lt; 100`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='00' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq &lt; 1000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='0' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq &lt; 10000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].client-key'
+ value="`$eipam-ip-block.plans[$pidx].requests[$ridx].vm-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].network-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-version + '|' +
+ $tmp.client-key.padding + $tmp.client-key.seq`"/>
+ <!-- rdn|zrdm3amdns02testdns001|data|static|VIP|4|0001 -->
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].info'
+ value='`$auto-ip-assignment-input.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='ridx' value='`$ridx + 1`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests_length' value='`$ridx`' />
+ </set>
+ </block>
+ </block>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`'>
+ <outcome value='6'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-use-dhcp`'>
+ <outcome value='N'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-count &gt; 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-address-plan-name`' />
+ <parameter name='generate-FQPN-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='generate-FQPN-input.subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='generate-FQPN-input.vrf-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-vrf-name`' />
+ <!--
+<parameter name='generate-FQPN-input.plans-index' value='`$pidx`' /><parameter name='generate-FQPN-input.requests-index' value='`$ridx`' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' 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="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-address-plan-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].address-family'
+ value="`'ipv' + $db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`" />
+ </set>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='true' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='0' />
+ </set>
+ <for index='vm-index' start='0' end='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' >
+ <for index='ipv6-index' start='0' end='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-count`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-version'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].use-dhcp'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-use-dhcp`' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='`$tmp.client-key.seq + 1`' />
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].'
+ value='generate-FQPN-output.' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vm-type'
+ value='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-type'
+ value='FIXED' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ </set>
+ <block>
+ <switch test='`$tmp.client-key.seq &lt; 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='000' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq &lt; 100`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='00' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq &lt; 1000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='0' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq &lt; 10000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].client-key'
+ value="`$eipam-ip-block.plans[$pidx].requests[$ridx].vm-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].network-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-version + '|' +
+ $tmp.client-key.padding + $tmp.client-key.seq`"/>
+ <!-- rdn|zrdm3amdns02testdns001|data|static|VIP|4|0001 -->
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].info'
+ value='`$auto-ip-assignment-input.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='ridx' value='`$ridx + 1`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests_length' value='`$ridx`' />
+ </set>
+ </block>
+ </block>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.plan-index-to-be-incremented`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='pidx' value='`$pidx + 1`' />
+ </set>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$pidx`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </for>
+ </block>
+ </for>
+ <for index='vm-type-index' start='0' end='`$db1.vf-module-to-vfc-mapping_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='vm-type-floating-loop' value = 'START' />
+ <parameter name='tmp.vm-type' value = '`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ </set>
+ <set>
+ <parameter name='db1.vfc-to-network-role-mapping.' value = '' />
+ </set>
+ <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 = $db1.vf-module-to-vfc-mapping[$vm-type-index].vfc-customization-uuid
+ AND (ipv4_count > 0 OR ipv6_count > 0 OR ipv4_floating_count > 0 OR ipv6_floating_count > 0)'
+ pfx='db1.vfc-to-network-role-mapping[]'>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='db1.vfc-to-network-role-mapping_length' value='0' />
+ </set>
+ </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 reading VFC_TO_NETWORK_ROLE_MAPPING table" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.db1.network-role' value = '' />
+ </set>
+ <for index='network-role-index' start='0' end='`$db1.vfc-to-network-role-mapping_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='network-role-loop' value = 'START' />
+ </set>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='false' />
+ </set>
+ <set>
+ <parameter name='tmp.network-role.found' value = 'false' />
+ </set>
+ <set>
+ <parameter name='tmp.db1.network-role' value = '`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ </set>
+ <block atomic="true">
+ <block>
+ <for index='q' start='0' end='`$tmp.network-role-query-results_length`' >
+ <set>
+ <parameter name='tmp.qresult.network-role' value = '`$tmp.network-role-query-results[$q].l3-network.network-role`' />
+ </set>
+ <switch test='`$tmp.qresult.network-role == $tmp.db1.network-role`' >
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.network-name'
+ value='`$tmp.network-role-query-results[$q].l3-network.network-name`' />
+ <parameter name='generate-FQPN-input.network-id'
+ value='`$tmp.network-role-query-results[$q].l3-network.network-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.network-role.found' value = 'true' />
+ </set>
+ <set>
+ <parameter name='query-results-found-index' value = '`$q`' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <return status='success'></return>
+ </block>
+ <switch test='`$tmp.network-role.found`'>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='query-aai-l3-network-by-network-role-input.aic-cloud-region'
+ value='`$auto-ip-assignment-input.aic-cloud-region`' />
+ <parameter name='query-aai-l3-network-by-network-role-input.service-instance-id'
+ value='`$auto-ip-assignment-input.service-instance-id`' />
+ <parameter name='query-aai-l3-network-by-network-role-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <!--
+filter options: service-instance-id, aic-cloud-region, null, Other (or any string)
+ - null or Other will filter by aic-cloud-region first, then service-instance-id
+<parameter name='query-aai-l3-network-by-network-role-input.filter'
+ value='service-instance-id' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='query-aai-l3-network-by-network-role' 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="`'An error occured while querying AAI to retrieve l3-network by network-role: ' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='generate-FQPN-input.network-name'
+ value='`$query-aai-l3-network-by-network-role-output.l3-network.network-name`' />
+ <parameter name='generate-FQPN-input.network-id'
+ value='`$query-aai-l3-network-by-network-role-output.l3-network.network-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.network-role-query-results[$qridx].l3-network.'
+ value='`$query-aai-l3-network-by-network-role-output.l3-network.`' />
+ <parameter name='tmp.network-role-query-results[$qridx].l3-network.network-role-tag'
+ value='`$tmp.db1.network-role-tag`' />
+ <!--
+<parameter name='tmp.network-role-query-results[$qridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' /><parameter name='tmp.network-role-query-results[$qridx].network-name'
+ value='`$query-aai-l3-network-by-network-role-output.l3-network.network-name`' />
+-->
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].l3-network.'
+ value='query-aai-l3-network-by-network-role-output.l3-network.' />
+ </set>
+ <set>
+ <parameter name='qridx' value='`$qridx + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.network-role-query-results_length' value='`$qridx`' />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='ridx' value='0' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].subnet-role'
+ value="`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`" />
+ </set>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`'>
+ <outcome value='4'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-use-dhcp`'>
+ <outcome value='N'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-count &gt; 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-address-plan-name`' />
+ <parameter name='generate-FQPN-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='generate-FQPN-input.subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='generate-FQPN-input.vrf-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-vrf-name`' />
+ <!--
+<parameter name='generate-FQPN-input.plans-index' value='`$pidx`' /><parameter name='generate-FQPN-input.requests-index' value='`$ridx`' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' 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="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-address-plan-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].address-family'
+ value="`'ipv' + $db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`" />
+ </set>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='true' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='0' />
+ </set>
+ <for index='vm-index' start='0' end='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' >
+ <for index='ipv4-index' start='0' end='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-count`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-version'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].use-dhcp'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-use-dhcp`' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='`$tmp.client-key.seq + 1`' />
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].'
+ value='generate-FQPN-output.' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vm-type'
+ value='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-type'
+ value='FIXED' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ </set>
+ <block>
+ <switch test='`$tmp.client-key.seq &lt; 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='000' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq &lt; 100`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='00' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq &lt; 1000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='0' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq &lt; 10000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].client-key'
+ value="`$eipam-ip-block.plans[$pidx].requests[$ridx].vm-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].network-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-version + '|' +
+ $tmp.client-key.padding + $tmp.client-key.seq`"/>
+ <!-- rdn|zrdm3amdns02testdns001|data|static|VIP|4|0001 -->
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].info'
+ value='`$auto-ip-assignment-input.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='ridx' value='`$ridx + 1`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests_length' value='`$ridx`' />
+ </set>
+ </block>
+ </block>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`'>
+ <outcome value='6'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-use-dhcp`'>
+ <outcome value='N'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-count &gt; 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-address-plan-name`' />
+ <parameter name='generate-FQPN-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='generate-FQPN-input.subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='generate-FQPN-input.vrf-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-vrf-name`' />
+ <!--
+<parameter name='generate-FQPN-input.plans-index' value='`$pidx`' /><parameter name='generate-FQPN-input.requests-index' value='`$ridx`' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' 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="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-address-plan-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].address-family'
+ value="`'ipv' + $db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`" />
+ </set>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='true' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='0' />
+ </set>
+ <for index='vm-index' start='0' end='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-count`' >
+ <for index='ipv6-index' start='0' end='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-count`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-version'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].use-dhcp'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-use-dhcp`' />
+ </set>
+ <set>
+ <parameter name='tmp.client-key.seq' value='`$tmp.client-key.seq + 1`' />
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].'
+ value='generate-FQPN-output.' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vm-type'
+ value='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-type'
+ value='FIXED' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ </set>
+ <block>
+ <switch test='`$tmp.client-key.seq &lt; 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='000' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq &lt; 100`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='00' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq &lt; 1000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='0' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.client-key.seq &lt; 10000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.client-key.padding' value='' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].client-key'
+ value="`$eipam-ip-block.plans[$pidx].requests[$ridx].vm-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].network-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-version + '|' +
+ $tmp.client-key.padding + $tmp.client-key.seq`"/>
+ <!-- rdn|zrdm3amdns02testdns001|data|static|VIP|4|0001 -->
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].info'
+ value='`$auto-ip-assignment-input.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='ridx' value='`$ridx + 1`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests_length' value='`$ridx`' />
+ </set>
+ </block>
+ </block>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.plan-index-to-be-incremented`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='pidx' value='`$pidx + 1`' />
+ </set>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$pidx`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].l3-network.'
+ value='tmp.network-role-query-results[$query-results-found-index].l3-network.' />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='ridx' value='0' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].subnet-role'
+ value="`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`" />
+ </set>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`'>
+ <outcome value='4'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-use-dhcp`'>
+ <outcome value='N'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-floating-count &gt; 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-address-plan-name`' />
+ <parameter name='generate-FQPN-input.subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='generate-FQPN-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='generate-FQPN-input.vrf-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-vrf-name`' />
+ <!--
+<parameter name='generate-FQPN-input.plans-index' value='`$pidx`' /><parameter name='generate-FQPN-input.requests-index' value='`$ridx`' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' 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="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-address-plan-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].address-family'
+ value="`'ipv' + $db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`" />
+ </set>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='true' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-version'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-ip-version`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].use-dhcp'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv4-use-dhcp`' />
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].'
+ value='generate-FQPN-output.' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vm-type'
+ value='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-type'
+ value='VIP' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].group-number'
+ value='1' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].client-key'
+ value="`$eipam-ip-block.plans[$pidx].requests[$ridx].vm-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].network-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-version + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].group-number + '|0001'`" />
+ <!-- rdn|data|static|FIXED|4|1|0001 -->
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].info'
+ value='`$auto-ip-assignment-input.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='ridx' value='`$ridx + 1`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests_length' value='`$ridx`' />
+ </set>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`'>
+ <outcome value='6'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-use-dhcp`'>
+ <outcome value='N'>
+ <switch test='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-floating-count &gt; 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-address-plan-name`' />
+ <parameter name='generate-FQPN-input.vrf-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-vrf-name`' />
+ <parameter name='generate-FQPN-input.subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='generate-FQPN-input.network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <!--
+<parameter name='generate-FQPN-input.plans-index' value='`$pidx`' /><parameter name='generate-FQPN-input.requests-index' value='`$ridx`' />
+-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' 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="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='tmp.plan-index-to-be-incremented' value='true' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].plan-name'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-address-plan-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].address-family'
+ value="`'ipv' + $db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`" />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-version'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-ip-version`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].use-dhcp'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].ipv6-use-dhcp`' />
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].'
+ value='generate-FQPN-output.' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vm-type'
+ value='`$db1.vf-module-to-vfc-mapping[$vm-type-index].vm-type`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].network-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].network-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role'
+ value='`$db1.vfc-to-network-role-mapping[$network-role-index].subnet-role`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].ip-type'
+ value='VIP' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].group-number'
+ value='1' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].vnfc-name'
+ value='`$auto-ip-assignment-input.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-index].vnfc-names[0].vnfc-name`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].client-key'
+ value="`$eipam-ip-block.plans[$pidx].requests[$ridx].vm-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].network-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].subnet-role + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-type + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].ip-version + '|' +
+ $eipam-ip-block.plans[$pidx].requests[$ridx].group-number + '|0001'`" />
+ <!-- rdn|data|static|FIXED|4|1|0001 -->
+ <parameter name='eipam-ip-block.plans[$pidx].requests[$ridx].info'
+ value='`$auto-ip-assignment-input.vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='ridx' value='`$ridx + 1`' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[$pidx].requests_length' value='`$ridx`' />
+ </set>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.plan-index-to-be-incremented`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='pidx' value='`$pidx + 1`' />
+ </set>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$pidx`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </for>
+ </block>
+ </for>
+ <block atomic='true'>
+ <switch test='`$eipam-ip-block.plans_length &gt; 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <switch test='`$auto-ip-assignment-input.service-type`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.service-information.service-type' value='NA' />
+ </set>
+ </outcome>
+ </switch>
+ <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 ip addresses from EIPAM: ' + $error-message`" />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-activate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-activate.xml
index 3cb6f936..06756c60 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-activate.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-activate.xml
@@ -1,295 +1,341 @@
-<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='contrail-route-topology-operation-activate' mode='sync'>
-<block atomic="true"><set>
-<parameter name='tmp.ar.allotted-resource-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
-<parameter name='tmp.ar.parent-service-instance-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
-
-
-
-</set><set>
-<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/'
+<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='contrail-route-topology-operation-activate' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ar.allotted-resource-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+ <parameter name='tmp.ar.parent-service-instance-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/'
+ $tmp.ar.allotted-resource-id
+ '/allotted-resource-data/contrail-route-topology/'` " />
-
-</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
- <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
- <parameter name='contextPrefix' value='prop' />
-</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/>
- <parameter name="outputPath" value="tmp.ar-url"/>
- <parameter name="target" value="{allotted-resource-id}"/>
- <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
-</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='GET' />
- <parameter name="responsePrefix" value="mdsal-ar" />
-
-<outcome value='success'>
-<block atomic="true">
-<switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'>
-<outcome value='1'>
-<block atomic='true'>
-<set>
-<parameter name='bk-cr-ar' value='$mdsal-ar.' />
-</set><set>
-<parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' />
-</set><switch test='`$ar.allotted-resource-data.allotted-resource-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"
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name='bk-cr-ar' value='$mdsal-ar.' />
+ </set>
+ <set>
+ <parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' />
+ </set>
+ <switch test='`$ar.allotted-resource-data.allotted-resource-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="`'Existing contrail-route-allotted-resource with order status of ' + $ar.allotted-resource-data.allotted-resource-oper-status.order-status + ', expecting Created.'`" />
-</return></outcome></switch><set>
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
-
-</set></block></outcome><outcome value='Other'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="404" />
- <parameter name="error-message" value="Error: Contrail Route not found" />
-
-</return></outcome></switch></block></outcome><outcome value='Other'>
-<block atomic="true">
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="404" />
- <parameter name="error-message" value="Error: Contrail Route not found" />
-
-</return></block></outcome></execute><set>
-<parameter name='ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
-<parameter name='ar.allotted-resource-status.action' value="`$contrail-route-topology-operation-input.request-information.request-action` " />
-<parameter name='ar.allotted-resource-status.rpc-name' value="contrail-route-topology-operation" />
-<parameter name='ar.allotted-resource-status.rpc-action' value="`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` " />
-<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$contrail-route-topology-operation-input.request-information.` " />
-<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$contrail-route-topology-operation-input.sdnc-request-header.` " />
-<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$contrail-route-topology-operation-input.service-information.` " />
-<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$contrail-route-topology-operation-input.allotted-resource-information.` " />
-<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.` " />
-</set><set>
-<parameter name='ar-assignments.' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.`" />
-
-
-
-</set><switch test='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`'>
-
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error activating contrail route. Source network not found" />
-</return></outcome><outcome value='Other'><block>
-<switch test='`$service-data.networks.network_length`'>
-<outcome value=''>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error activating contrail route. Source network not found" />
-</return></outcome><outcome value='Other'>
-<block atomic="true"><for index='nidx' start='0' end='`$service-data.networks.network_length`' >
-<switch test="`$service-data.networks.network[$nidx].network-id == $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`">
-
-<outcome value='true'>
-<block>
-<set>
-<parameter name='tmp.ar.tenant-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.tenant`' />
-<parameter name='tmp.ar.cloud-region-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.aic-cloud-region`' />
-
-
-</set><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="tenant"
- key="cloud-region.cloud-owner = 'CloudOwner' AND
- cloud-region.cloud-region-id = $tmp.ar.cloud-region-id AND
- tenant.tenant-id = $tmp.ar.tenant-id"
- pfx='aai.tenant' local-only='false' >
-
-<outcome value='success'>
-<block atomic="true"><set>
-<parameter name='tmp.ar.tenant-name' value='`$aai.tenant.tenant-name`' />
-
-
-</set></block></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="Tenant not found in AAI" />
-
-</return></outcome><outcome value='Other'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Tenant not found in AAI" />
-
-</return></outcome></get-resource></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="Error activating contrail route. Source network not found" />
-</return></outcome></switch></for></block></outcome></switch></block></outcome></switch><set>
-<parameter name='tmp.fq-name' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name` " />
-</set><set>
-<parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />
-</set><execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
-<parameter name='api-name' value='network-policy' />
-<parameter name='api-action' value='apply' />
-<parameter name='resp-prefix' value='contrailResp' />
-<parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />
-<parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
-<parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.contrail-fq-name`' />
-<parameter name='contrail-virtual-network-id' value='`$aai.src-network.contrail-network-fqdn`' />
-
-<outcome value='success'>
-<block>
-</block></outcome><outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Failed to apply policy in Contrail to source network" />
-</return></outcome></execute><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Contrail Route not found" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Contrail Route not found" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <parameter name='ar.allotted-resource-status.action' value="`$contrail-route-topology-operation-input.request-information.request-action` " />
+ <parameter name='ar.allotted-resource-status.rpc-name' value="contrail-route-topology-operation" />
+ <parameter name='ar.allotted-resource-status.rpc-action' value="`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$contrail-route-topology-operation-input.request-information.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$contrail-route-topology-operation-input.sdnc-request-header.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$contrail-route-topology-operation-input.service-information.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$contrail-route-topology-operation-input.allotted-resource-information.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.` " />
+ </set>
+ <set>
+ <parameter name='ar-assignments.' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.`" />
+ </set>
+ <switch test='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error activating contrail route. Source network not found" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error activating contrail route. Source network not found" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='nidx' start='0' end='`$service-data.networks.network_length`' >
+ <switch test="`$service-data.networks.network[$nidx].network-id == $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`">
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.ar.cloud-region-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.aic-cloud-region`' />
+ </set>
+ </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="Error activating contrail route. Source network not found" />
+ </return>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.fq-name' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name` " />
+ </set>
+ <set>
+ <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='apply' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.contrail-fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$aai.src-network.contrail-network-fqdn`' />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to apply policy in Contrail to source network" />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="l3-network"
key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.dest-network.network-id"
local-only="false"
pfx="aai.dest-network">
-<outcome value='not-found'>
-<return status='failure'>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /></return></outcome><outcome value='failure'>
-<return status='failure'>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /></return></outcome><outcome value='success'>
-<block atomic="true"></block></outcome></get-resource><execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
-<parameter name='api-name' value='network-policy' />
-<parameter name='api-action' value='apply' />
-<parameter name='resp-prefix' value='contrailResp' />
-<parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />
-<parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
-<parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.contrail-fq-name`' />
-<parameter name='contrail-virtual-network-id' value='`$aai.dest-network.contrail-network-fqdn`' />
-
-<outcome value='success'>
-<block>
-</block></outcome><outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Failed to apply policy in Contrail to source network" />
-</return></outcome></execute><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ </get-resource>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='apply' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.contrail-fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$aai.dest-network.contrail-network-fqdn`' />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to apply policy in Contrail to source network" />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="related-link"
key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id"
local-only="true"
pfx="tmp.AnAI-src">
-
-
-
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Failed to get related link for l3-network in AAI" />
-</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="Failed to get related link for l3-network in AAI" />
-</return></outcome></get-resource><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to get related link for l3-network in AAI" />
+ </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="Failed to get related link for l3-network in AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="related-link"
key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.dest-network.network-id"
local-only="true"
pfx="tmp.AnAI-dest">
-
-
-
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Failed to get related link for l3-network in AAI" />
-</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="Failed to get related link for l3-network in AAI" />
-</return></outcome></get-resource><save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to get related link for l3-network in AAI" />
+ </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="Failed to get related link for l3-network in AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="network-policy:relationship-list"
key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
-<parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
-<parameter name="relationship-list.relationship[0].related-link" value="`tmp.AnAI-src.related-link`" />
-<parameter name="relationship-list.relationship[1].related-to" value="l3-network" />
-<parameter name="relationship-list.relationship[1].related-link" value="`tmp.AnAI-dest.related-link`" />
-
-
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Failed to save network policy in AAI" />
-</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="Failed to save network policy in AAI" />
-</return></outcome></save><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`tmp.AnAI-src.related-link`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[1].related-link" value="`tmp.AnAI-dest.related-link`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to save network policy in AAI" />
+ </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="Failed to save network policy in AAI" />
+ </return>
+ </outcome>
+ </save>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="allotted-resource"
key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
service-subscription.service-type = $service-data.service-information.subscription-service-type AND
service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
allotted-resource.id = $tmp.ar.allotted-resource-id"
pfx='pfx' local-only='false' force='false'>
- <parameter name="operational-status" value="in-service-path" />
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="AAI failed" />
-</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="AAI failed" />
-</return></outcome></update><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
- <parameter name="outputPath" value="tmp.current-time" />
-
-</execute><set>
-<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Active' />
-<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$contrail-route-topology-operation-input.request-information.request-action`' />
-<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`' />
-<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-request-id`' />
-<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
-</set><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='PUT' />
- <parameter name="responsePrefix" value="mdsal-ar" />
-
-<outcome value='success'>
-<block>
-</block></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 updating md-sal for contrail-route-allotted-resource" />
-</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="Error updating md-sal for contrail-route-allotted-resource" />
-</return></outcome></execute><set>
-<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
-<parameter name='contrail-route-object-path' value="`$tmp.ar.self-link`"/>
-<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ <parameter name="operational-status" value="in-service-path" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </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="AAI failed" />
+ </return>
+ </outcome>
+ </update>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Active' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$contrail-route-topology-operation-input.request-information.request-action`' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-request-id`' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block></block>
+ </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 updating md-sal for contrail-route-allotted-resource" />
+ </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="Error updating md-sal for contrail-route-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+ <parameter name='contrail-route-object-path' value="`$tmp.ar.self-link`"/>
+ <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ $contrail-route-topology-operation-input.service-information.service-instance-id
+ '/service-data/service-topology/'`"/>
-
-</set><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>
+ </set>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-assign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-assign.xml
index 997695b0..444b50d6 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-assign.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-assign.xml
@@ -1,981 +1,981 @@
-<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='contrail-route-topology-operation-assign' mode='sync'>
- <block atomic="true">
- <set>
- <parameter name='tmp.ar.allotted-resource-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
- <parameter name='tmp.ar.parent-service-instance-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
- <parameter name='tmp.ar.contrail-applied-service-instance-id' value='`$contrail-route-topology-operation-input.contrail-route-request-input.contrail-applied-service-info.service-instance-id`' />
- <parameter name='tmp.ar.allotted-resource-type' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-type`' />
- </set>
- <set>
- <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/'
- + $tmp.ar.allotted-resource-id
- + '/allotted-resource-data/contrail-route-topology/'` " />
- </set>
- <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
- <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
- <parameter name='contextPrefix' value='prop' />
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/>
- <parameter name="outputPath" value="tmp.ar-url"/>
- <parameter name="target" value="{allotted-resource-id}"/>
- <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$prop.restapi.network`"/>
- <parameter name="outputPath" value="tmp.ar-parentnetwork-url"/>
- <parameter name="target" value="{service-instance-id}"/>
- <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/>
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$prop.restapi.vnf`"/>
- <parameter name="outputPath" value="tmp.ar-contrailappliedsvc-url"/>
- <parameter name="target" value="{service-instance-id}"/>
- <parameter name="replacement" value="`$tmp.ar.contrail-applied-service-instance-id`"/>
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$prop.restapi.parent-provided-resource`"/>
- <parameter name="outputPath" value="tmp.parent-ar-url"/>
- <parameter name="target" value="{service-instance-id}"/>
- <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/>
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.parent-ar-url`"/>
- <parameter name="outputPath" value="tmp.parent-ar-url"/>
- <parameter name="target" value="{allotted-resource-id}"/>
- <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$prop.restapi.network-provided-resource`"/>
- <parameter name="outputPath" value="tmp.network-ar-url"/>
- <parameter name="target" value="{service-instance-id}"/>
- <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/>
- </execute>
- <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='GET' />
- <parameter name="responsePrefix" value="mdsal-ar" />
- <outcome value='success'>
- <block atomic="true">
- <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'>
- <outcome value='1'>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error: Existing contrail route allotted resource" />
- </return>
- </outcome>
- </switch>
- </block>
- </outcome>
- <outcome value='Other'>
- <block atomic="true"></block>
- </outcome>
- </execute>
- <set>
- <parameter name='ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
- <parameter name='ar.allotted-resource-status.action' value="`$contrail-route-topology-operation-input.request-information.request-action` " />
- <parameter name='ar.allotted-resource-status.rpc-name' value="contrail-route-topology-operation" />
- <parameter name='ar.allotted-resource-status.rpc-action' value="`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` " />
- <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$contrail-route-topology-operation-input.request-information.` " />
- <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$contrail-route-topology-operation-input.sdnc-request-header.` " />
- <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$contrail-route-topology-operation-input.service-information.` " />
- <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$contrail-route-topology-operation-input.allotted-resource-information.` " />
- <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.` " />
- </set>
- <set>
- <parameter name='ar-identifiers.consuming-service-instance-id' value="`$contrail-route-topology-operation-input.service-information.service-instance-id` " />
- <parameter name='ar-identifiers.parent-service-instance-id' value="`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id` " />
- <parameter name='ar-identifiers.allotted-resource-type' value="`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-type` " />
- <parameter name='ar-identifiers.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
- </set>
- <set>
- <parameter name='ar.allotted-resource-data.contrail-route-topology.onap-model-information.'
-value="`$contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.`" />
- </set>
- <switch test='$contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-invariant-uuid'>
- <outcome value=''>
- <set>
- <parameter name='ar.allotted-resource-data.contrail-route-topology.onap-model-information.model-invariant-uuid'
-value="`$ar-model.invariant-uuid`" />
- </set>
- </outcome>
- </switch>
- <switch test='$contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-uuid'>
- <outcome value=''>
- <set>
- <parameter name='sar.allotted-resource-data.contrail-route-topology.onap-model-information.model-uuid'
-value="`$ar-model.uuid`" />
- </set>
- </outcome>
- </switch>
- <switch test='$contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-version'>
- <outcome value=''>
- <set>
- <parameter name='ar.allotted-resource-data.contrail-route-topology.onap-model-information.model-version'
-value="`$ar-model.version`" />
- </set>
- </outcome>
- </switch>
- <switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-id`'>
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error assigning contrail route. Source network not found" />
- </return>
- </outcome>
- <outcome value='Other'>
- <block>
- <switch test='`$service-data.networks.network_length`'>
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error assigning contrail route. Source network not found" />
- </return>
- </outcome>
- <outcome value='Other'>
- <block atomic="true">
- <set>
- <parameter name='source-network-found' value='false' />
- </set>
- <for index='nidx' start='0' end='`$service-data.networks.network_length`' >
- <block>
- <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="tmp.ar-name="/>
- <parameter name="field3" value="`$tmp.ar-name`"/>
- <parameter name="field4" value="service-data-network-id" />
- <parameter name="field5" value="`$service-data.networks.network[$nidx].network-id`" />
- <parameter name="field6" value="contrail-route-input-network-id" />
- <parameter name="field7" value="`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-id`" />
- <parameter name="field8" value="`$nidx`" />
- </record>
- <switch test="`$service-data.networks.network[$nidx].network-id == $contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-id`">
- <outcome value='true'>
- <block>
- <set>
- <parameter name='tmp.ar.tenant-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.tenant`' />
- <parameter name='tmp.ar.cloud-region-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.aic-cloud-region`' />
- <parameter name='source-network-found' value='true' />
- </set>
- <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="tenant"
- key="cloud-region.cloud-owner = 'CloudOwner' AND
- cloud-region.cloud-region-id = $tmp.ar.cloud-region-id AND
- tenant.tenant-id = $tmp.ar.tenant-id"
- pfx='aai.tenant' local-only='false' >
- <outcome value='success'>
- <block atomic="true">
- <set>
- <parameter name='tmp.ar.tenant-name' value='`$aai.tenant.tenant-name`' />
- </set>
- </block>
- </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="Tenant not found in AAI" />
- </return>
- </outcome>
- <outcome value='Other'>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Tenant not found in AAI" />
- </return>
- </outcome>
- </get-resource>
- </block>
- </outcome>
- </switch>
- </block>
- </for>
- <switch test="`$source-network-found`">
- <outcome value='false'>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error assigning contrail route. Source network not found" />
- </return>
- </outcome>
- </switch>
- </block>
- </outcome>
- </switch>
- </block>
- </outcome>
- </switch>
- <switch test='`$ar-model.ecomp-generated-naming`'>
- <outcome value='Y'>
- <block atomic="true">
- <switch test='`$ar-model.naming-policy`'>
- <outcome value='oam_network_policy'>
- <block atomic='true'>
- <set>
- <parameter name='tmp.ar-name' value='$TenantName_$CloudRegionID_$TenantNetworkRole_$LandingNetworkRole_policy_' />
- </set>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.ar-name`"/>
- <parameter name="outputPath" value="tmp.ar-name"/>
- <parameter name="target" value="$TenantName"/>
- <parameter name="replacement" value="`$tmp.ar.tenant-name`"/>
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.ar-name`"/>
- <parameter name="outputPath" value="tmp.ar-name"/>
- <parameter name="target" value="$CloudRegionID"/>
- <parameter name="replacement" value="`$tmp.ar.cloud-region-id`"/>
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.ar-name`"/>
- <parameter name="outputPath" value="tmp.ar-name"/>
- <parameter name="target" value="$TenantNetworkRole"/>
- <parameter name="replacement" value="`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-role`"/>
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.ar-name`"/>
- <parameter name="outputPath" value="tmp.ar-name"/>
- <parameter name="target" value="$LandingNetworkRole"/>
- <parameter name="replacement" value="`$contrail-route-topology-operation-input.contrail-route-request-input.dest-network.network-role`"/>
- </execute>
- <set>
- <parameter name='generate-unique-name-input.index-table-name' value='CONTRAIL_ROUTE_NAME_INDEX' />
- <parameter name='generate-unique-name-input.index-table-prefix-column' value='contrail_route_name_prefix' />
- <parameter name='generate-unique-name-input.name-table-type' value='CONTRAIL_ROUTE_INSTANCE' />
- <parameter name='generate-unique-name-input.prefix' value="`$tmp.ar-name`" />
- <parameter name='generate-unique-name-input.index-length' value='2' />
- </set>
- <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="tmp.ar-name="/>
- <parameter name="field3" value="`$tmp.ar-name`"/>
- <parameter name="field4" value="generate-unique-name-input.prefix" />
- <parameter name="field5" value="`$generate-unique-name-input.prefix`" />
- </record>
- <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.ar-name' value='`$generate-unique-name-output.generated-name`' />
- </set>
- </outcome>
- </call>
- <set>
- <parameter name='ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
- </set>
- </block>
- </outcome>
- <outcome value='Other'>
- <block atomic='true'>
- <set>
- <parameter name='tmp.ar-name' value='$TenantName_$CloudRegionID_$TenantNetworkRole_$LandingNetworkRole_policy_' />
- </set>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.ar-name`"/>
- <parameter name="outputPath" value="tmp.ar-name"/>
- <parameter name="target" value="$TenantName"/>
- <parameter name="replacement" value="`$tmp.ar.tenant-name`"/>
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.ar-name`"/>
- <parameter name="outputPath" value="tmp.ar-name"/>
- <parameter name="target" value="$CloudRegionID"/>
- <parameter name="replacement" value="`$tmp.ar.cloud-region-id`"/>
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.ar-name`"/>
- <parameter name="outputPath" value="tmp.ar-name"/>
- <parameter name="target" value="$TenantNetworkRole"/>
- <parameter name="replacement" value="`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-role`"/>
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.ar-name`"/>
- <parameter name="outputPath" value="tmp.ar-name"/>
- <parameter name="target" value="$LandingNetworkRole"/>
- <parameter name="replacement" value="`$contrail-route-topology-operation-input.contrail-route-request-input.dest-network.network-role`"/>
- </execute>
- <set>
- <parameter name='generate-unique-name-input.index-table-name' value='CONTRAIL_ROUTE_NAME_INDEX' />
- <parameter name='generate-unique-name-input.index-table-prefix-column' value='contrail_route_name_prefix' />
- <parameter name='generate-unique-name-input.name-table-type' value='CONTRAIL_ROUTE_INSTANCE' />
- <parameter name='generate-unique-name-input.prefix' value="`$tmp.ar-name`" />
- <parameter name='generate-unique-name-input.index-length' value='2' />
- </set>
- <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="tmp.ar-name="/>
- <parameter name="field3" value="`$tmp.ar-name`"/>
- <parameter name="field4" value="generate-unique-name-input.prefix" />
- <parameter name="field5" value="`$generate-unique-name-input.prefix`" />
- </record>
- <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.ar-name' value='`$generate-unique-name-output.generated-name`' />
- </set>
- </outcome>
- </call>
- <set>
- <parameter name='ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
- </set>
- </block>
- </outcome>
- </switch>
- </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="Error in allotted-resource-model data. Ecomp-generated-naming should be true" />
- </return>
- </outcome>
- </switch>
- <set>
- <parameter name='ar.allotted-resource-data.contrail-route-topology.allotted-resource-identifiers.'
-value="`$ar-identifiers.`" />
- </set>
- <set>
- <parameter name='ar-assignments.source-network.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.` " />
- <parameter name='ar-assignments.dest-network.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.dest-network.` " />
- <parameter name='ar-assignments.contrail-applied-service.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.contrail-applied-service-info.` " />
- </set>
- <set>
- <parameter name='tmp.fq-name' value='$defaultDomain.$defaultProject.$sdncNetworkPolicy' />
- </set>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.fq-name`"/>
- <parameter name="outputPath" value="tmp.fq-name"/>
- <parameter name="target" value="$defaultDomain"/>
- <parameter name="replacement" value="default-domain"/>
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.fq-name`"/>
- <parameter name="outputPath" value="tmp.fq-name"/>
- <parameter name="target" value="$defaultProject"/>
- <parameter name="replacement" value="`$tmp.ar.tenant-name`"/>
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.fq-name`"/>
- <parameter name="outputPath" value="tmp.fq-name"/>
- <parameter name="target" value="$sdncNetworkPolicy"/>
- <parameter name="replacement" value="`$tmp.ar-name`"/>
- </execute>
- <switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.dest-network.network-id`'>
- <outcome value=''>
- <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-parentnetwork-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='GET' />
- <parameter name="responsePrefix" value="parent-net" />
- <outcome value='success'>
- <block atomic="true">
- <switch test='`$parent-net.networks.network_length`'>
- <outcome value='1'>
- <set>
- <parameter name='ar-assignments.dest-network.network-id' value="`$parent-net.networks.network[0].network-id` " />
- </set>
- </outcome>
- <outcome value='Other'>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error: Network id not found. Parent Service should only have one network" />
- </return>
- </outcome>
- </switch>
- </block>
- </outcome>
- <outcome value='Other'>
- <block atomic="true">
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error: No existing parent netorks" />
- </return>
- </block>
- </outcome>
- </execute>
- </outcome>
- <outcome value='Other'>
- <set>
- <parameter name='ar-assignments.dest-network.network-id' value="`$contrail-route-request-input.dest-network.network-id` " />
- </set>
- </outcome>
- </switch>
- <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-contrailappliedsvc-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='GET' />
- <parameter name="responsePrefix" value="vnf" />
- <outcome value='success'>
- <block atomic="true">
- <switch test='`$vnf.vnfs.vnf_length`'>
- <outcome value='1'>
- <set>
- <parameter name='ar-assignments.contrail-applied-service.vnf-id' value="`$vnf.vnfs.vnf[0].vnf-id` " />
- </set>
- </outcome>
- <outcome value='Other'>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error: vnf id not found. Contrail applied service should only have one vnf" />
- </return>
- </outcome>
- </switch>
- </block>
- </outcome>
- <outcome value='Other'>
- <block atomic="true">
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error: No existing contrail applied service vnfs" />
- </return>
- </block>
- </outcome>
- </execute>
- <switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.contrail-applied-service-info.contrail-fqdn`'>
- <outcome value=''>
- <block atomic="true">
- <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="generic-vnf"
- key="generic-vnf.vnf-id = $ar-assignments.contrail-applied-service.vnf-id"
- pfx='aai.vnf' 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="Vnf 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 vnf from AAI" />
- </return>
- </outcome>
- </get-resource>
- <switch test='`$aai.vnf.vf-modules.vf-module_length`'>
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="VF Module not found in AAI" />
- </return>
- </outcome>
- <outcome value='Other'>
- <for index='idx' start='0' end='`$aai.vnf.vf-modules.vf-module_length`' >
- <switch test='`$aai-vf-module.contrail-service-instance-fqdn`'>
- <outcome value=''>
- <block></block>
- </outcome>
- <outcome value='Other'>
- <block>
- <set>
- <parameter name='ar-assignments.contrail-applied-service.contrail-fqdn' value="`$aai-vf-module.contrail-service-instance-fqdn` " />
- </set>
- <break/>
- </block>
- </outcome>
- </switch>
- </for>
- </outcome>
- </switch>
- </block>
- </outcome>
- <outcome value='Other'>
- <set>
- <parameter name='ar-assignments.contrail-applied-service.contrail-fqdn' value="`$contrail-route-topology-operation-input.contrail-route-request-input.contrail-applied-service-info.contrail-fqdn` " />
- </set>
- </outcome>
- </switch>
- <switch test='`$ar-assignments.contrail-applied-service.contrail-fqdn`'>
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error: No vf-module with contrail-service-instance-fqdn found in AAI" />
- </return>
- </outcome>
- </switch>
- <set>
- <parameter name='ar-assignments.fq-name' value="`$tmp.fq-name` " />
- </set>
- <set>
- <parameter name='ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.'
-value="`$ar-assignments.`" />
- </set>
- <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'>
- <outcome value=''>
- <set>
- <parameter name='tmp.cidx' value="`0`" />
- <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value="1" />
- </set>
- </outcome>
- <outcome value='Other'>
- <block atomic="true">
- <for index='cidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' >
- <switch test="`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].allotted-resource-id == $tmp.ar.allotted-resource-id`">
- <outcome value='true'>
- <block atomic="true">
- <set>
- <parameter name='tmp.cidx' value='`$cidx`' />
- <parameter name='ctx.consumed-ar.' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].`' />
- <parameter name='tmp.found-cidx' value='true' />
- </set>
- <break/>
- </block>
- </outcome>
- </switch>
- </for>
- <switch test='`$tmp.found-cidx`'>
- <outcome value='false'>
- <block atomic="true">
- <set>
- <parameter name='tmp.cidx' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' />
- </set>
- </block>
- </outcome>
- </switch>
- </block>
- </outcome>
- </switch>
- <set>
- <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
- <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-type' value="`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-type` " />
- <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-pointer' value="`$tmp.ar.self-link` " />
- <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value='`$tmp.cidx + 1`' />
- </set>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
- <parameter name="outputPath" value="tmp.current-time" />
- </execute>
- <set>
- <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingCreate' />
- <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$contrail-route-topology-operation-input.request-information.request-action`' />
- <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`' />
- <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-request-id`' />
- <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
- </set>
- <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="allotted-resource"
- key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
- service-subscription.service-type = $service-data.service-information.subscription-service-type AND
- service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
- allotted-resource.id = $tmp.ar.allotted-resource-id"
- pfx='pfx' local-only='false' force='false'>
- <parameter name="description" value="`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-type`" />
- <parameter name="selflink" value="`$tmp.ar.self-link`" />
- <parameter name="model-invariant-id" value="`$ar-model.invariant-uuid`" />
- <parameter name="model-version-id" value="`$ar-model.uuid`" />
- <parameter name="operational-status" value="null" />
- <outcome value='failure'>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="AAI failed" />
- </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="AAI failed" />
- </return>
- </outcome>
- </update>
- <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='PUT' />
- <parameter name="responsePrefix" value="parent" />
- <outcome value='success'>
- <block></block>
- </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 updating md-sal for contrail-route-allotted-resource" />
- </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="Error updating md-sal for contrail-route-allotted-resource" />
- </return>
- </outcome>
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.network-ar-url`"/>
- <parameter name="outputPath" value="tmp.network-ar-url"/>
- <parameter name="target" value="{network-id}"/>
- <parameter name="replacement" value="`$ar-assignments.dest-network.network-id`"/>
- </execute>
- <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='GET' />
- <parameter name="responsePrefix" value="net-ar" />
- <outcome value='success'>
- <block atomic="true">
- <set>
- <parameter name='tmp.found-nidx' value='false' />
- </set>
- <switch test='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`'>
- <outcome value=''>
- <block atomic="true">
- <set>
- <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id_length' value="1" />
- <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id[0]' value="`$tmp.ar.allotted-resource-id`" />
- </set>
- <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='PUT' />
- <parameter name="responsePrefix" value="p-network-ar" />
- <outcome value='success'>
- <block></block>
- </outcome>
- <outcome value='failure'>
- <block></block>
- </outcome>
- <outcome value='not-found'>
- <block></block>
- </outcome>
- </execute>
- </block>
- </outcome>
- <outcome value='Other'>
- <block atomic="true">
- <for index='nidx' start='0' end='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' >
- <switch test="`$net-ar.network-provided-allotted-resources.network-provided-ar-id[$nidx] == $tmp.ar.allotted-resource-id`">
- <outcome value='true'>
- <block atomic="true">
- <set>
- <parameter name='tmp.found-nidx' value='true' />
- </set>
- <break/>
- </block>
- </outcome>
- </switch>
- </for>
- <switch test='`$tmp.found-nidx`'>
- <outcome value='false'>
- <block atomic="true">
- <set>
- <parameter name='tmp.nidx' value='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' />
- </set>
- <set>
- <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id_length' value='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length + 1`' />
- <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id[$tmp.nidx]' value="`$tmp.ar.allotted-resource-id`" />
- </set>
- <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='PUT' />
- <parameter name="responsePrefix" value="p-network-ar" />
- <outcome value='success'>
- <block></block>
- </outcome>
- <outcome value='failure'>
- <block></block>
- </outcome>
- <outcome value='not-found'>
- <block></block>
- </outcome>
- </execute>
- </block>
- </outcome>
- </switch>
- </block>
- </outcome>
- </switch>
- </block>
- </outcome>
- <outcome value='not-found'>
- <block atomic="true">
- <set>
- <parameter name='tmp.found-nidx' value='false' />
- </set>
- <switch test='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`'>
- <outcome value=''>
- <block atomic="true">
- <set>
- <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id_length' value="1" />
- <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id[0]' value="`$tmp.ar.allotted-resource-id`" />
- </set>
- <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='PUT' />
- <parameter name="responsePrefix" value="p-network-ar" />
- <outcome value='success'>
- <block></block>
- </outcome>
- <outcome value='failure'>
- <block></block>
- </outcome>
- <outcome value='not-found'>
- <block></block>
- </outcome>
- </execute>
- </block>
- </outcome>
- <outcome value='Other'>
- <block atomic="true">
- <for index='nidx' start='0' end='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' >
- <switch test="`$net-ar.network-provided-allotted-resources.network-provided-ar-id[$nidx] == $tmp.ar.allotted-resource-id`">
- <outcome value='true'>
- <block atomic="true">
- <set>
- <parameter name='tmp.found-nidx' value='true' />
- </set>
- <break/>
- </block>
- </outcome>
- </switch>
- </for>
- <switch test='`$tmp.found-nidx`'>
- <outcome value='false'>
- <block atomic="true">
- <set>
- <parameter name='tmp.nidx' value='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' />
- </set>
- <set>
- <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id_length' value='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length + 1`' />
- <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id[$tmp.nidx]' value="`$tmp.ar.allotted-resource-id`" />
- </set>
- <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='PUT' />
- <parameter name="responsePrefix" value="p-network-ar" />
- <outcome value='success'>
- <block></block>
- </outcome>
- <outcome value='failure'>
- <block></block>
- </outcome>
- <outcome value='not-found'>
- <block></block>
- </outcome>
- </execute>
- </block>
- </outcome>
- </switch>
- </block>
- </outcome>
- </switch>
- </block>
- </outcome>
- <outcome value='failure'>
- <block atomic="true">
- <set>
- <parameter name='tmp.found-nidx' value='false' />
- </set>
- <switch test='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`'>
- <outcome value=''>
- <block atomic="true">
- <set>
- <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id_length' value="1" />
- <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id[0]' value="`$tmp.ar.allotted-resource-id`" />
- </set>
- <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='PUT' />
- <parameter name="responsePrefix" value="p-network-ar" />
- <outcome value='success'>
- <block></block>
- </outcome>
- <outcome value='failure'>
- <block></block>
- </outcome>
- <outcome value='not-found'>
- <block></block>
- </outcome>
- </execute>
- </block>
- </outcome>
- <outcome value='Other'>
- <block atomic="true">
- <for index='nidx' start='0' end='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' >
- <switch test="`$net-ar.network-provided-allotted-resources.network-provided-ar-id[$nidx] == $tmp.ar.allotted-resource-id`">
- <outcome value='true'>
- <block atomic="true">
- <set>
- <parameter name='tmp.found-nidx' value='true' />
- </set>
- <break/>
- </block>
- </outcome>
- </switch>
- </for>
- <switch test='`$tmp.found-nidx`'>
- <outcome value='false'>
- <block atomic="true">
- <set>
- <parameter name='tmp.nidx' value='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' />
- </set>
- <set>
- <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id_length' value='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length + 1`' />
- <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id[$tmp.nidx]' value="`$tmp.ar.allotted-resource-id`" />
- </set>
- <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='PUT' />
- <parameter name="responsePrefix" value="p-network-ar" />
- <outcome value='success'>
- <block></block>
- </outcome>
- <outcome value='failure'>
- <block></block>
- </outcome>
- <outcome value='not-found'>
- <block></block>
- </outcome>
- </execute>
- </block>
- </outcome>
- </switch>
- </block>
- </outcome>
- </switch>
- </block>
- </outcome>
- </execute>
- <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='PUT' />
- <parameter name="responsePrefix" value="mdsal-ar" />
- <outcome value='failure'>
- <block>
- <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='DELETE' />
- <parameter name="responsePrefix" value="parent" />
- <outcome value='success'>
- <block></block>
- </outcome>
- <outcome value='failure'>
- <block></block>
- </outcome>
- <outcome value='not-found'>
- <block></block>
- </outcome>
- </execute>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource. Parent provided resource rolled back" />
- </return>
- </block>
- </outcome>
- <outcome value='not-found'>
- <block>
- <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='DELETE' />
- <parameter name="responsePrefix" value="parent" />
- <outcome value='success'>
- <block></block>
- </outcome>
- <outcome value='failure'>
- <block></block>
- </outcome>
- <outcome value='not-found'>
- <block></block>
- </outcome>
- </execute>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource. Parent provided resource rolled back" />
- </return>
- </block>
- </outcome>
- </execute>
- <set>
- <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
- <parameter name='contrail-route-object-path' value="`$tmp.ar.self-link`"/>
- <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
- + $contrail-route-topology-operation-input.service-information.service-instance-id
- + '/service-data/service-topology/'`"/>
- </set>
- <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>
+<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='contrail-route-topology-operation-assign' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ar.allotted-resource-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+ <parameter name='tmp.ar.parent-service-instance-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+ <parameter name='tmp.ar.contrail-applied-service-instance-id' value='`$contrail-route-topology-operation-input.contrail-route-request-input.contrail-applied-service-info.service-instance-id`' />
+ <parameter name='tmp.ar.allotted-resource-type' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-type`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/contrail-route-topology/'` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.network`"/>
+ <parameter name="outputPath" value="tmp.ar-parentnetwork-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vnf`"/>
+ <parameter name="outputPath" value="tmp.ar-contrailappliedsvc-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.contrail-applied-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.parent-provided-resource`"/>
+ <parameter name="outputPath" value="tmp.parent-ar-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.parent-ar-url`"/>
+ <parameter name="outputPath" value="tmp.parent-ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.network-provided-resource`"/>
+ <parameter name="outputPath" value="tmp.network-ar-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'>
+ <outcome value='1'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error: Existing contrail route allotted resource" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <parameter name='ar.allotted-resource-status.action' value="`$contrail-route-topology-operation-input.request-information.request-action` " />
+ <parameter name='ar.allotted-resource-status.rpc-name' value="contrail-route-topology-operation" />
+ <parameter name='ar.allotted-resource-status.rpc-action' value="`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$contrail-route-topology-operation-input.request-information.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$contrail-route-topology-operation-input.sdnc-request-header.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$contrail-route-topology-operation-input.service-information.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$contrail-route-topology-operation-input.allotted-resource-information.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.` " />
+ </set>
+ <set>
+ <parameter name='ar-identifiers.consuming-service-instance-id' value="`$contrail-route-topology-operation-input.service-information.service-instance-id` " />
+ <parameter name='ar-identifiers.parent-service-instance-id' value="`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id` " />
+ <parameter name='ar-identifiers.allotted-resource-type' value="`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-type` " />
+ <parameter name='ar-identifiers.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ </set>
+ <set>
+ <parameter name='ar.allotted-resource-data.contrail-route-topology.onap-model-information.'
+value="`$contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.`" />
+ </set>
+ <switch test='$contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-invariant-uuid'>
+ <outcome value=''>
+ <set>
+ <parameter name='ar.allotted-resource-data.contrail-route-topology.onap-model-information.model-invariant-uuid'
+value="`$ar-model.invariant-uuid`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='$contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-uuid'>
+ <outcome value=''>
+ <set>
+ <parameter name='sar.allotted-resource-data.contrail-route-topology.onap-model-information.model-uuid'
+value="`$ar-model.uuid`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='$contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-version'>
+ <outcome value=''>
+ <set>
+ <parameter name='ar.allotted-resource-data.contrail-route-topology.onap-model-information.model-version'
+value="`$ar-model.version`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error assigning contrail route. Source network not found" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error assigning contrail route. Source network not found" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='source-network-found' value='false' />
+ </set>
+ <for index='nidx' start='0' end='`$service-data.networks.network_length`' >
+ <block>
+ <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="tmp.ar-name="/>
+ <parameter name="field3" value="`$tmp.ar-name`"/>
+ <parameter name="field4" value="service-data-network-id" />
+ <parameter name="field5" value="`$service-data.networks.network[$nidx].network-id`" />
+ <parameter name="field6" value="contrail-route-input-network-id" />
+ <parameter name="field7" value="`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-id`" />
+ <parameter name="field8" value="`$nidx`" />
+ </record>
+ <switch test="`$service-data.networks.network[$nidx].network-id == $contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-id`">
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.ar.tenant-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.tenant`' />
+ <parameter name='tmp.ar.cloud-region-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.aic-cloud-region`' />
+ <parameter name='source-network-found' value='true' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="tenant"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $tmp.ar.cloud-region-id AND
+ tenant.tenant-id = $tmp.ar.tenant-id"
+ pfx='aai.tenant' local-only='false' >
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ar.tenant-name' value='`$aai.tenant.tenant-name`' />
+ </set>
+ </block>
+ </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="Tenant not found in AAI" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Tenant not found in AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$source-network-found`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error assigning contrail route. Source network not found" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$ar-model.ecomp-generated-naming`'>
+ <outcome value='Y'>
+ <block atomic="true">
+ <switch test='`$ar-model.naming-policy`'>
+ <outcome value='oam_network_policy'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.ar-name' value='$TenantName_$CloudRegionID_$TenantNetworkRole_$LandingNetworkRole_policy_' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$TenantName"/>
+ <parameter name="replacement" value="`$tmp.ar.tenant-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$CloudRegionID"/>
+ <parameter name="replacement" value="`$tmp.ar.cloud-region-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$TenantNetworkRole"/>
+ <parameter name="replacement" value="`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-role`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$LandingNetworkRole"/>
+ <parameter name="replacement" value="`$contrail-route-topology-operation-input.contrail-route-request-input.dest-network.network-role`"/>
+ </execute>
+ <set>
+ <parameter name='generate-unique-name-input.index-table-name' value='CONTRAIL_ROUTE_NAME_INDEX' />
+ <parameter name='generate-unique-name-input.index-table-prefix-column' value='contrail_route_name_prefix' />
+ <parameter name='generate-unique-name-input.name-table-type' value='CONTRAIL_ROUTE_INSTANCE' />
+ <parameter name='generate-unique-name-input.prefix' value="`$tmp.ar-name`" />
+ <parameter name='generate-unique-name-input.index-length' value='2' />
+ </set>
+ <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="tmp.ar-name="/>
+ <parameter name="field3" value="`$tmp.ar-name`"/>
+ <parameter name="field4" value="generate-unique-name-input.prefix" />
+ <parameter name="field5" value="`$generate-unique-name-input.prefix`" />
+ </record>
+ <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.ar-name' value='`$generate-unique-name-output.generated-name`' />
+ </set>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.ar-name' value='$TenantName_$CloudRegionID_$TenantNetworkRole_$LandingNetworkRole_policy_' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$TenantName"/>
+ <parameter name="replacement" value="`$tmp.ar.tenant-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$CloudRegionID"/>
+ <parameter name="replacement" value="`$tmp.ar.cloud-region-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$TenantNetworkRole"/>
+ <parameter name="replacement" value="`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-role`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$LandingNetworkRole"/>
+ <parameter name="replacement" value="`$contrail-route-topology-operation-input.contrail-route-request-input.dest-network.network-role`"/>
+ </execute>
+ <set>
+ <parameter name='generate-unique-name-input.index-table-name' value='CONTRAIL_ROUTE_NAME_INDEX' />
+ <parameter name='generate-unique-name-input.index-table-prefix-column' value='contrail_route_name_prefix' />
+ <parameter name='generate-unique-name-input.name-table-type' value='CONTRAIL_ROUTE_INSTANCE' />
+ <parameter name='generate-unique-name-input.prefix' value="`$tmp.ar-name`" />
+ <parameter name='generate-unique-name-input.index-length' value='2' />
+ </set>
+ <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="tmp.ar-name="/>
+ <parameter name="field3" value="`$tmp.ar-name`"/>
+ <parameter name="field4" value="generate-unique-name-input.prefix" />
+ <parameter name="field5" value="`$generate-unique-name-input.prefix`" />
+ </record>
+ <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.ar-name' value='`$generate-unique-name-output.generated-name`' />
+ </set>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </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="Error in allotted-resource-model data. Ecomp-generated-naming should be true" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='ar.allotted-resource-data.contrail-route-topology.allotted-resource-identifiers.'
+value="`$ar-identifiers.`" />
+ </set>
+ <set>
+ <parameter name='ar-assignments.source-network.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.` " />
+ <parameter name='ar-assignments.dest-network.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.dest-network.` " />
+ <parameter name='ar-assignments.contrail-applied-service.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.contrail-applied-service-info.` " />
+ </set>
+ <set>
+ <parameter name='tmp.fq-name' value='$defaultDomain.$defaultProject.$sdncNetworkPolicy' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.fq-name`"/>
+ <parameter name="outputPath" value="tmp.fq-name"/>
+ <parameter name="target" value="$defaultDomain"/>
+ <parameter name="replacement" value="default-domain"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.fq-name`"/>
+ <parameter name="outputPath" value="tmp.fq-name"/>
+ <parameter name="target" value="$defaultProject"/>
+ <parameter name="replacement" value="`$tmp.ar.tenant-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.fq-name`"/>
+ <parameter name="outputPath" value="tmp.fq-name"/>
+ <parameter name="target" value="$sdncNetworkPolicy"/>
+ <parameter name="replacement" value="`$tmp.ar-name`"/>
+ </execute>
+ <switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.dest-network.network-id`'>
+ <outcome value=''>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-parentnetwork-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="parent-net" />
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$parent-net.networks.network_length`'>
+ <outcome value='1'>
+ <set>
+ <parameter name='ar-assignments.dest-network.network-id' value="`$parent-net.networks.network[0].network-id` " />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error: Network id not found. Parent Service should only have one network" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error: No existing parent netorks" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='ar-assignments.dest-network.network-id' value="`$contrail-route-topology-operation-input.contrail-route-request-input.dest-network.network-id` " />
+ </set>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-contrailappliedsvc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="vnf" />
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$vnf.vnfs.vnf_length`'>
+ <outcome value='1'>
+ <set>
+ <parameter name='ar-assignments.contrail-applied-service.vnf-id' value="`$vnf.vnfs.vnf[0].vnf-id` " />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error: vnf id not found. Contrail applied service should only have one vnf" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error: No existing contrail applied service vnfs" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.contrail-applied-service-info.contrail-fqdn`'>
+ <outcome value=''>
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $ar-assignments.contrail-applied-service.vnf-id"
+ pfx='aai.vnf' 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="Vnf 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 vnf from AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test='`$aai.vnf.vf-modules.vf-module_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="VF Module not found in AAI" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <for index='idx' start='0' end='`$aai.vnf.vf-modules.vf-module_length`' >
+ <switch test='`$aai.vnf.vf-modules.vf-module[$idx].contrail-service-instance-fqdn`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='ar-assignments.contrail-applied-service.contrail-fqdn' value="`$aai.vnf.vf-modules.vf-module[$idx].contrail-service-instance-fqdn` " />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='ar-assignments.contrail-applied-service.contrail-fqdn' value="`$contrail-route-topology-operation-input.contrail-route-request-input.contrail-applied-service-info.contrail-fqdn` " />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$ar-assignments.contrail-applied-service.contrail-fqdn`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error: No vf-module with contrail-service-instance-fqdn found in AAI" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='ar-assignments.fq-name' value="`$tmp.fq-name` " />
+ </set>
+ <set>
+ <parameter name='ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.'
+value="`$ar-assignments.`" />
+ </set>
+ <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.cidx' value="`0`" />
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value="1" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='cidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' >
+ <switch test="`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].allotted-resource-id == $tmp.ar.allotted-resource-id`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.cidx' value='`$cidx`' />
+ <parameter name='ctx.consumed-ar.' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].`' />
+ <parameter name='tmp.found-cidx' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.found-cidx`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.cidx' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-type' value="`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-type` " />
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-pointer' value="`$tmp.ar.self-link` " />
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value='`$tmp.cidx + 1`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingCreate' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$contrail-route-topology-operation-input.request-information.request-action`' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-request-id`' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="description" value="`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-type`" />
+ <parameter name="selflink" value="`$tmp.ar.self-link`" />
+ <parameter name="model-invariant-id" value="`$ar-model.invariant-uuid`" />
+ <parameter name="model-version-id" value="`$ar-model.uuid`" />
+ <parameter name="operational-status" value="null" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </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="AAI failed" />
+ </return>
+ </outcome>
+ </update>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="parent" />
+ <outcome value='success'>
+ <block></block>
+ </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 updating md-sal for contrail-route-allotted-resource" />
+ </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="Error updating md-sal for contrail-route-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.network-ar-url`"/>
+ <parameter name="outputPath" value="tmp.network-ar-url"/>
+ <parameter name="target" value="{network-id}"/>
+ <parameter name="replacement" value="`$ar-assignments.dest-network.network-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="net-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.found-nidx' value='false' />
+ </set>
+ <switch test='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id_length' value="1" />
+ <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id[0]' value="`$tmp.ar.allotted-resource-id`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="p-network-ar" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='nidx' start='0' end='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' >
+ <switch test="`$net-ar.network-provided-allotted-resources.network-provided-ar-id[$nidx] == $tmp.ar.allotted-resource-id`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.found-nidx' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.found-nidx`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.nidx' value='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' />
+ </set>
+ <set>
+ <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id_length' value='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length + 1`' />
+ <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id[$tmp.nidx]' value="`$tmp.ar.allotted-resource-id`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="p-network-ar" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.found-nidx' value='false' />
+ </set>
+ <switch test='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id_length' value="1" />
+ <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id[0]' value="`$tmp.ar.allotted-resource-id`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="p-network-ar" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='nidx' start='0' end='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' >
+ <switch test="`$net-ar.network-provided-allotted-resources.network-provided-ar-id[$nidx] == $tmp.ar.allotted-resource-id`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.found-nidx' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.found-nidx`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.nidx' value='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' />
+ </set>
+ <set>
+ <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id_length' value='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length + 1`' />
+ <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id[$tmp.nidx]' value="`$tmp.ar.allotted-resource-id`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="p-network-ar" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.found-nidx' value='false' />
+ </set>
+ <switch test='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id_length' value="1" />
+ <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id[0]' value="`$tmp.ar.allotted-resource-id`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="p-network-ar" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='nidx' start='0' end='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' >
+ <switch test="`$net-ar.network-provided-allotted-resources.network-provided-ar-id[$nidx] == $tmp.ar.allotted-resource-id`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.found-nidx' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.found-nidx`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.nidx' value='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' />
+ </set>
+ <set>
+ <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id_length' value='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length + 1`' />
+ <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id[$tmp.nidx]' value="`$tmp.ar.allotted-resource-id`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="p-network-ar" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='failure'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="parent" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource. Parent provided resource rolled back" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="parent" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for contrail-route-allotted-resource. Parent provided resource rolled back" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+ <parameter name='contrail-route-object-path' value="`$tmp.ar.self-link`"/>
+ <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $contrail-route-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-create.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-create.xml
index b17e9d99..2f3c907b 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-create.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-create.xml
@@ -1,308 +1,380 @@
-<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='contrail-route-topology-operation-create' mode='sync'>
-<block atomic="true"><set>
-<parameter name='tmp.ar.allotted-resource-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
-<parameter name='tmp.ar.parent-service-instance-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
-
-
-
-</set><set>
-<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/'
- + $tmp.ar.allotted-resource-id
- + '/allotted-resource-data/contrail-route-topology/'` " />
-
-</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
- <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
- <parameter name='contextPrefix' value='prop' />
-</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/>
- <parameter name="outputPath" value="tmp.ar-url"/>
- <parameter name="target" value="{allotted-resource-id}"/>
- <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
-</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='GET' />
- <parameter name="responsePrefix" value="mdsal-ar" />
-
-<outcome value='success'>
-<block atomic="true">
-<switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'>
-<outcome value='1'>
-<block atomic='true'>
-<set>
-<parameter name='bk-cr-ar' value='$mdsal-ar.' />
-</set><set>
-<parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' />
-</set></block></outcome><outcome value='Other'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="404" />
- <parameter name="error-message" value="Error: Contrail Route not found" />
-
-</return></outcome></switch></block></outcome><outcome value='Other'>
-<block atomic="true">
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="404" />
- <parameter name="error-message" value="Error: Contrail Route not found" />
-
-</return></block></outcome></execute><set>
-<parameter name='ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
-<parameter name='ar.allotted-resource-status.action' value="`$contrail-route-topology-operation-input.request-information.request-action` " />
-<parameter name='ar.allotted-resource-status.rpc-name' value="contrail-route-topology-operation" />
-<parameter name='ar.allotted-resource-status.rpc-action' value="`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` " />
-<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$contrail-route-topology-operation-input.request-information.` " />
-<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$contrail-route-topology-operation-input.sdnc-request-header.` " />
-<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$contrail-route-topology-operation-input.service-information.` " />
-<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$contrail-route-topology-operation-input.allotted-resource-information.` " />
-<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.` " />
-</set><set>
-<parameter name='ar-assignments.' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.`" />
-
-
-
-</set><switch test='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`'>
-
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error assigning contrail route. Source network not found" />
-</return></outcome><outcome value='Other'><block>
-<switch test='`$service-data.networks.network_length`'>
-<outcome value=''>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error assigning contrail route. Source network not found" />
-</return></outcome><outcome value='Other'>
-<block atomic="true"><for index='nidx' start='0' end='`$service-data.networks.network_length`' >
-<switch test="`$service-data.networks.network[$nidx].network-id == $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`">
-
-<outcome value='true'>
-<block>
-<set>
-<parameter name='tmp.ar.tenant-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.tenant`' />
-<parameter name='tmp.ar.cloud-region-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.aic-cloud-region`' />
-
-
-</set><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="tenant"
- key="cloud-region.cloud-owner = 'CloudOwner' AND
- cloud-region.cloud-region-id = $tmp.ar.cloud-region-id AND
- tenant.tenant-id = $tmp.ar.tenant-id"
- pfx='aai.tenant' local-only='false' >
-
-<outcome value='success'>
-<block atomic="true"><set>
-<parameter name='tmp.ar.tenant-name' value='`$aai.tenant.tenant-name`' />
-
-
-</set></block></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="Tenant not found in AAI" />
-
-</return></outcome><outcome value='Other'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Tenant not found in AAI" />
-
-</return></outcome></get-resource></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="Error assigning contrail route. Source network not found" />
-</return></outcome></switch></for></block></outcome></switch></block></outcome></switch><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="l3-network"
- key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id"
- local-only="false"
- pfx="aai.src-network">
-<outcome value='not-found'>
-<return status='failure'>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /></return></outcome><outcome value='failure'>
-<return status='failure'>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /></return></outcome><outcome value='success'>
-<block atomic="true"></block></outcome></get-resource><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="l3-network"
- key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.dest-network.network-id"
- local-only="false"
- pfx="aai.dest-network">
-<outcome value='not-found'>
-<return status='failure'>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /></return></outcome><outcome value='failure'>
-<return status='failure'>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /></return></outcome><outcome value='success'>
-<block atomic="true"></block></outcome></get-resource><set>
-<parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />
-</set><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.contrail-route-topology-operation-create"/>
-<parameter name='field3' value='network-policy' />
-<parameter name='field4' value='create' />
-<parameter name='field5' value='contrailResp' />
-<parameter name='field6' value='default-domain' />
-<parameter name='field7' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name`' />
-<parameter name='field8' value='`$tmp.ar.tenant-name`' />
-<parameter name='field9' value='`$ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.contrail-applied-service-info.contrail-fqdn`' />
-<parameter name='field10' value='$aai.dest-network.contrail-network-fqdn' />
-<parameter name='field11' value='$aai.src-network.contrail-network-fqdn' />
-<parameter name='field12' value='&lt;&gt;' />
-<parameter name='field13' value='$tmp.ar.cloud-region-id' />
-
-
-</record><execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
-<parameter name='api-name' value='network-policy' />
-<parameter name='api-action' value='create' />
-<parameter name='resp-prefix' value='contrailResp' />
-<parameter name='default-domain' value='default-domain' />
-<parameter name='policy-name' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name`' />
-<parameter name='default-project' value='`$tmp.ar.tenant-name`' />
-<!-- dummy for dev <parameter name='default-project' value='default-project' /> -->
-<parameter name='vipr-service-instance' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.contrail-applied-service.contrail-fqdn`' />
-<parameter name='dst-virtual-network' value='`$aai.dest-network.contrail-network-fqdn`' />
-<parameter name='src-virtual-network' value='`$aai.src-network.contrail-network-fqdn`' />
-<parameter name='direction' value='&lt;&gt;' />
-<parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />
-
-<outcome value='success'>
-<block>
-</block></outcome><outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'Failed to create policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" />
-</return></outcome></execute><switch test='`$contrailResp.resp-code`'>
-
-<outcome value='0'>
-<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="`'Failed to create policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" />
-</return></outcome></switch><set>
-<parameter name='ar-assignments.contrail-id' value="`$contrailResp.network-policy.uuid`" />
-
-
-
-</set><call module='GENERIC-RESOURCE-API' rpc='policy-manager-create-policy' mode='sync' >
-<outcome value='failure'>
-<block atomic="true">
-<execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
-<parameter name='api-name' value='network-policy' />
-<parameter name='api-action' value='delete' />
-<parameter name='resp-prefix' value='contrailResp' />
-<parameter name='default-domain' value='default-domain' />
-<parameter name='policy-name' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name`' />
-<parameter name='default-project' value='`$tmp.ar.tenant-name`' />
-<!-- dummy for dev <parameter name='default-project' value='default-project' /> -->
-<parameter name='vipr-service-instance' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.contrail-applied-service.contrail-fqdn`' />
-<parameter name='dst-virtual-network' value='`$aai.dest-network.contrail-network-fqdn`' />
-<parameter name='src-virtual-network' value='`$aai.src-network.contrail-network-fqdn`' />
-<parameter name='direction' value='&lt;&gt;' />
-<parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />
-
-<outcome value='success'>
-<block>
-</block></outcome><outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'Failed to create Policy in Policy Mgr. Rollback failed to delete policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" />
-</return></outcome></execute><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'Failed to create policy in PolicyMgr. '+ $error-message + 'Contrail network policy rolled back.'`" />
-</return></block></outcome><outcome value='success'>
-<block atomic="true"></block></outcome></call><save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="network-policy"
- key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
-<!-- Create l3-network object -->
-<parameter name="network-policy-id" value="`$ar-assignments.contrail-id`" />
-<parameter name="network-policy-fqdn" value="`$ar-assignments.fq-name`" />
-
-
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Failed to save network policy in AAI" />
-</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="Failed to save network policy in AAI" />
-</return></outcome></save><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="allotted-resource"
- key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
- service-subscription.service-type = $service-data.service-information.subscription-service-type AND
- service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
- allotted-resource.id = $tmp.ar.allotted-resource-id"
- pfx='pfx' local-only='false' force='false'>
- <parameter name="operational-status" value="out-of-service-path" />
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="AAI failed" />
-</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="AAI failed" />
-</return></outcome></update><set>
-<parameter name='ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.' value='`$ar-assignments.`' />
-
-
-
-</set><set>
-<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Created' />
-<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$contrail-route-topology-operation-input.request-information.request-action`' />
-<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`' />
-<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-request-id`' />
-<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
-</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
- <parameter name="outputPath" value="tmp.current-time" />
-
-</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='PUT' />
- <parameter name="responsePrefix" value="mdsal-ar" />
-
-<outcome value='success'>
-<block>
-</block></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 updating md-sal for contrail-route-allotted-resource" />
-</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="Error updating md-sal for contrail-route-allotted-resource" />
-</return></outcome></execute><set>
-<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
-<parameter name='contrail-route-object-path' value="`$tmp.ar.self-link`"/>
-<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
- + $contrail-route-topology-operation-input.service-information.service-instance-id
- + '/service-data/service-topology/'`"/>
-
-</set><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>
+<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='contrail-route-topology-operation-create' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ar.allotted-resource-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+ <parameter name='tmp.ar.parent-service-instance-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/contrail-route-topology/'` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name='bk-cr-ar' value='$mdsal-ar.' />
+ </set>
+ <set>
+ <parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Contrail Route not found" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Contrail Route not found" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <parameter name='ar.allotted-resource-status.action' value="`$contrail-route-topology-operation-input.request-information.request-action` " />
+ <parameter name='ar.allotted-resource-status.rpc-name' value="contrail-route-topology-operation" />
+ <parameter name='ar.allotted-resource-status.rpc-action' value="`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$contrail-route-topology-operation-input.request-information.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$contrail-route-topology-operation-input.sdnc-request-header.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$contrail-route-topology-operation-input.service-information.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$contrail-route-topology-operation-input.allotted-resource-information.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.` " />
+ </set>
+ <set>
+ <parameter name='ar-assignments.' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.`" />
+ </set>
+ <switch test='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error assigning contrail route. Source network not found" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error assigning contrail route. Source network not found" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='nidx' start='0' end='`$service-data.networks.network_length`' >
+ <switch test="`$service-data.networks.network[$nidx].network-id == $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`">
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.ar.tenant-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.tenant`' />
+ <parameter name='tmp.ar.cloud-region-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.aic-cloud-region`' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="tenant"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $tmp.ar.cloud-region-id AND
+ tenant.tenant-id = $tmp.ar.tenant-id"
+ pfx='aai.tenant' local-only='false' >
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ar.tenant-name' value='`$aai.tenant.tenant-name`' />
+ </set>
+ </block>
+ </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="Tenant not found in AAI" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Tenant not found in AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ </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="Error assigning contrail route. Source network not found" />
+ </return>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id"
+ local-only="false"
+ pfx="aai.src-network">
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ </get-resource>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.dest-network.network-id"
+ local-only="false"
+ pfx="aai.dest-network">
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />
+ </set>
+ <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.contrail-route-topology-operation-create"/>
+ <parameter name='field3' value='network-policy' />
+ <parameter name='field4' value='create' />
+ <parameter name='field5' value='contrailResp' />
+ <parameter name='field6' value='default-domain' />
+ <parameter name='field7' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name`' />
+ <parameter name='field8' value='`$tmp.ar.tenant-name`' />
+ <parameter name='field9' value='`$ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.contrail-applied-service-info.contrail-fqdn`' />
+ <parameter name='field10' value='$aai.dest-network.contrail-network-fqdn' />
+ <parameter name='field11' value='$aai.src-network.contrail-network-fqdn' />
+ <parameter name='field12' value='&lt;&gt;' />
+ <parameter name='field13' value='$tmp.ar.cloud-region-id' />
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='create' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='default-domain' value='default-domain' />
+ <parameter name='policy-name' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name`' />
+ <parameter name='default-project' value='`$tmp.ar.tenant-name`' />
+ <!-- dummy for dev <parameter name='default-project' value='default-project' /> -->
+ <parameter name='vipr-service-instance' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.contrail-applied-service.contrail-fqdn`' />
+ <parameter name='dst-virtual-network' value='`$aai.dest-network.contrail-network-fqdn`' />
+ <parameter name='src-virtual-network' value='`$aai.src-network.contrail-network-fqdn`' />
+ <parameter name='direction' value='&lt;&gt;' />
+ <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to create policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" />
+ </return>
+ </outcome>
+ </execute>
+ <switch test='`$contrailResp.resp-code`'>
+ <outcome value='0'>
+ <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="`'Failed to create policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='ar-assignments.contrail-id' value="`$contrailResp.network-policy.uuid`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='policy-manager-create-policy' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to create Policy in Policy Mgr. Rollback failed to delete policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" />
+ </return>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to create policy in PolicyMgr. '+ $error-message + 'Contrail network policy rolled back.'`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ </call>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-policy-id" value="`$ar-assignments.contrail-id`" />
+ <parameter name="network-policy-fqdn" value="`$ar-assignments.fq-name`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to save network policy in AAI" />
+ </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="Failed to save network policy in AAI" />
+ </return>
+ </outcome>
+ </save>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="operational-status" value="out-of-service-path" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </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="AAI failed" />
+ </return>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.' value='`$ar-assignments.`' />
+ </set>
+ <set>
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Created' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$contrail-route-topology-operation-input.request-information.request-action`' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-request-id`' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block></block>
+ </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 updating md-sal for contrail-route-allotted-resource" />
+ </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="Error updating md-sal for contrail-route-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+ <parameter name='contrail-route-object-path' value="`$tmp.ar.self-link`"/>
+ <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $contrail-route-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-deactivate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-deactivate.xml
index ec9d9b21..5fc21d2d 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-deactivate.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-deactivate.xml
@@ -1,264 +1,309 @@
-<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='contrail-route-topology-operation-deactivate' mode='sync'>
-<block atomic="true"><set>
-<parameter name='tmp.ar.allotted-resource-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
-<parameter name='tmp.ar.parent-service-instance-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
-<parameter name='tmp.ar.sz-vnf-id' value='`$contrail-route-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' />
-
-
-</set><set>
-<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/'
- + $tmp.ar.allotted-resource-id
- + '/allotted-resource-data/contrail-route-topology/'` " />
-
-</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
- <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
- <parameter name='contextPrefix' value='prop' />
-</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/>
- <parameter name="outputPath" value="tmp.ar-url"/>
- <parameter name="target" value="{allotted-resource-id}"/>
- <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
-</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='GET' />
- <parameter name="responsePrefix" value="mdsal-ar" />
-
-<outcome value='success'>
-<block atomic="true">
-<switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'>
-<outcome value='1'>
-<block atomic='true'>
-<set>
-<parameter name='bk-cr-ar' value='$mdsal-ar.' />
-</set><set>
-<parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' />
-</set><set>
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
-
-</set></block></outcome><outcome value='Other'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="404" />
- <parameter name="error-message" value="Error: Contrail Route not found" />
-
-</return></outcome></switch></block></outcome><outcome value='Other'>
-<block atomic="true">
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="404" />
- <parameter name="error-message" value="Error: Contrail Route not found" />
-
-</return></block></outcome></execute><set>
-<parameter name='ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
-<parameter name='ar.allotted-resource-status.action' value="`$contrail-route-topology-operation-input.request-information.request-action` " />
-<parameter name='ar.allotted-resource-status.rpc-name' value="contrail-route-topology-operation" />
-<parameter name='ar.allotted-resource-status.rpc-action' value="`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` " />
-<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$contrail-route-topology-operation-input.request-information.` " />
-<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$contrail-route-topology-operation-input.sdnc-request-header.` " />
-<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$contrail-route-topology-operation-input.service-information.` " />
-<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$contrail-route-topology-operation-input.allotted-resource-information.` " />
-<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.` " />
-</set><set>
-<parameter name='ar-assignments.' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.`" />
-
-
-
-</set><switch test='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`'>
-
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error activating contrail route. Source network not found" />
-</return></outcome><outcome value='Other'><block>
-<switch test='`$service-data.networks.network_length`'>
-<outcome value=''>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error activating contrail route. Source network not found" />
-</return></outcome><outcome value='Other'>
-<block atomic="true"><for index='nidx' start='0' end='`$service-data.networks.network_length`' >
-<switch test="`$service-data.networks.network[$nidx].network-id == $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`">
-
-<outcome value='true'>
-<block>
-<set>
-<parameter name='tmp.ar.tenant-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.tenant`' />
-<parameter name='tmp.ar.cloud-region-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.aic-cloud-region`' />
-
-
-</set><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="tenant"
- key="cloud-region.cloud-owner = 'CloudOwner' AND
- cloud-region.cloud-region-id = $tmp.ar.cloud-region-id AND
- tenant.tenant-id = $tmp.ar.tenant-id"
- pfx='aai.tenant' local-only='false' >
-
-<outcome value='success'>
-<block atomic="true"><set>
-<parameter name='tmp.ar.tenant-name' value='`$aai.tenant.tenant-name`' />
-
-
-</set></block></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="Tenant not found in AAI" />
-
-</return></outcome><outcome value='Other'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Tenant not found in AAI" />
-
-</return></outcome></get-resource></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="Error activating contrail route. Source network not found" />
-</return></outcome></switch></for></block></outcome></switch></block></outcome></switch><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="l3-network"
- key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id"
- local-only="false"
- pfx="aai.src-network">
-<outcome value='not-found'>
-<return status='failure'>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /></return></outcome><outcome value='failure'>
-<return status='failure'>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /></return></outcome><outcome value='success'>
-<block atomic="true"></block></outcome></get-resource><set>
-<parameter name='tmp.fq-name' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name` " />
-</set><set>
-<parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />
-</set><execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
-<parameter name='api-name' value='network-policy' />
-<parameter name='api-action' value='remove' />
-<parameter name='resp-prefix' value='contrailResp' />
-<parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />
-<parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
-<parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.contrail-fq-name`' />
-<parameter name='contrail-virtual-network-id' value='`$aai.src-network.contrail-network-fqdn`' />
-
-<outcome value='success'>
-<block>
-</block></outcome><outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Failed to remove policy in Contrail from source network" />
-</return></outcome></execute><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="l3-network"
- key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.dest-network.network-id"
- local-only="false"
- pfx="aai.dest-network">
-<outcome value='not-found'>
-<return status='failure'>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /></return></outcome><outcome value='failure'>
-<return status='failure'>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" /></return></outcome><outcome value='success'>
-<block atomic="true"></block></outcome></get-resource><execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
-<parameter name='api-name' value='network-policy' />
-<parameter name='api-action' value='remove' />
-<parameter name='resp-prefix' value='contrailResp' />
-<parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />
-<parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
-<parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.contrail-fq-name`' />
-<parameter name='contrail-virtual-network-id' value='`$aai.dest-network.contrail-network-fqdn`' />
-
-<outcome value='success'>
-<block>
-</block></outcome><outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Failed to remove policy in Contrail from dest network" />
-</return></outcome></execute><delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="network-policy:relationship-list"
- key="network-policy.network-policy-id = $ar-assignments.contrail-id and related-to = 'l3-network' " >
-
-
-
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Failed to save network policy in AAI" />
-</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="Failed to save network policy in AAI" />
-</return></outcome></delete><set>
-<parameter name='ar-assignments.vlan-tag' value="" />
-
-
-
-</set><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="allotted-resource"
- key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
- service-subscription.service-type = $service-data.service-information.subscription-service-type AND
- service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
- allotted-resource.id = $tmp.ar.allotted-resource-id"
- pfx='pfx' local-only='false' force='false'>
- <parameter name="operational-status" value="out-of-service-path" />
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="AAI failed" />
-</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="AAI failed" />
-</return></outcome></update><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
- <parameter name="outputPath" value="tmp.current-time" />
-
-</execute><set>
-<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' />
-<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$contrail-route-topology-operation-input.request-information.request-action`' />
-<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`' />
-<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-request-id`' />
-<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
-</set><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='PUT' />
- <parameter name="responsePrefix" value="mdsal-ar" />
-
-<outcome value='success'>
-<block>
-</block></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 updating md-sal for contrail-route-allotted-resource" />
-</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="Error updating md-sal for contrail-route-allotted-resource" />
-</return></outcome></execute><set>
-<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
-<parameter name='contrail-route-object-path' value="`$tmp.ar.self-link`"/>
-<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
- + $contrail-route-topology-operation-input.service-information.service-instance-id
- + '/service-data/service-topology/'`"/>
-
-</set><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>
+<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='contrail-route-topology-operation-deactivate' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ar.allotted-resource-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+ <parameter name='tmp.ar.parent-service-instance-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+ <parameter name='tmp.ar.sz-vnf-id' value='`$contrail-route-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/contrail-route-topology/'` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name='bk-cr-ar' value='$mdsal-ar.' />
+ </set>
+ <set>
+ <parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' />
+ </set>
+ <set>
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Contrail Route not found" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Contrail Route not found" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <parameter name='ar.allotted-resource-status.action' value="`$contrail-route-topology-operation-input.request-information.request-action` " />
+ <parameter name='ar.allotted-resource-status.rpc-name' value="contrail-route-topology-operation" />
+ <parameter name='ar.allotted-resource-status.rpc-action' value="`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$contrail-route-topology-operation-input.request-information.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$contrail-route-topology-operation-input.sdnc-request-header.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$contrail-route-topology-operation-input.service-information.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$contrail-route-topology-operation-input.allotted-resource-information.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.` " />
+ </set>
+ <set>
+ <parameter name='ar-assignments.' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.`" />
+ </set>
+ <switch test='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error activating contrail route. Source network not found" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error activating contrail route. Source network not found" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='nidx' start='0' end='`$service-data.networks.network_length`' >
+ <switch test="`$service-data.networks.network[$nidx].network-id == $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`">
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.ar.cloud-region-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.aic-cloud-region`' />
+ </set>
+ </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="Error activating contrail route. Source network not found" />
+ </return>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id"
+ local-only="false"
+ pfx="aai.src-network">
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving source network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.fq-name' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.fq-name` " />
+ </set>
+ <set>
+ <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.contrail-fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$aai.src-network.contrail-network-fqdn`' />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to remove policy in Contrail from source network" />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.dest-network.network-id"
+ local-only="false"
+ pfx="aai.dest-network">
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving destination network with network-id=' + $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ </get-resource>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='remove' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <parameter name='contrail-network-policy-fq-name' value='`$ar-assignments.contrail-fq-name`' />
+ <parameter name='contrail-virtual-network-id' value='`$aai.dest-network.contrail-network-fqdn`' />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to remove policy in Contrail from dest network" />
+ </return>
+ </outcome>
+ </execute>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy:relationship-list"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id and related-to = 'l3-network' " >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to save network policy in AAI" />
+ </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="Failed to save network policy in AAI" />
+ </return>
+ </outcome>
+ </delete>
+ <set>
+ <parameter name='ar-assignments.vlan-tag' value="" />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="operational-status" value="out-of-service-path" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </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="AAI failed" />
+ </return>
+ </outcome>
+ </update>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$contrail-route-topology-operation-input.request-information.request-action`' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-request-id`' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block></block>
+ </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 updating md-sal for contrail-route-allotted-resource" />
+ </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="Error updating md-sal for contrail-route-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+ <parameter name='contrail-route-object-path' value="`$tmp.ar.self-link`"/>
+ <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $contrail-route-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-delete.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-delete.xml
index 176ac419..c57b5f9a 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-delete.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-delete.xml
@@ -1,226 +1,258 @@
-<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='contrail-route-topology-operation-delete' mode='sync'>
-<block atomic="true"><set>
-<parameter name='tmp.ar.allotted-resource-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
-<parameter name='tmp.ar.parent-service-instance-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
-<parameter name='tmp.ar.sz-vnf-id' value='`$contrail-route-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' />
-
-
-</set><set>
-<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/'
- + $tmp.ar.allotted-resource-id
- + '/allotted-resource-data/contrail-route-topology/'` " />
-
-</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
- <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
- <parameter name='contextPrefix' value='prop' />
-</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/>
- <parameter name="outputPath" value="tmp.ar-url"/>
- <parameter name="target" value="{allotted-resource-id}"/>
- <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
-</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='GET' />
- <parameter name="responsePrefix" value="mdsal-ar" />
-
-<outcome value='success'>
-<block atomic="true">
-<switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'>
-<outcome value='1'>
-<block atomic='true'>
-<set>
-<parameter name='bk-cr-ar' value='$mdsal-ar.' />
-</set><set>
-<parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' />
-</set><switch test='`$ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
-<outcome value='PendingDelete'>
-<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="`'Existing contrail-route-allotted-resource with order status of ' + $ar.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`" />
-</return></outcome></switch><set>
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
-
-</set></block></outcome><outcome value='Other'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="404" />
- <parameter name="error-message" value="Error: Contrail Route not found" />
-
-</return></outcome></switch></block></outcome><outcome value='Other'>
-<block atomic="true">
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="404" />
- <parameter name="error-message" value="Error: Contrail Route not found" />
-
-</return></block></outcome></execute><set>
-<parameter name='ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
-<parameter name='ar.allotted-resource-status.action' value="`$contrail-route-topology-operation-input.request-information.request-action` " />
-<parameter name='ar.allotted-resource-status.rpc-name' value="contrail-route-topology-operation" />
-<parameter name='ar.allotted-resource-status.rpc-action' value="`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` " />
-<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$contrail-route-topology-operation-input.request-information.` " />
-<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$contrail-route-topology-operation-input.sdnc-request-header.` " />
-<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$contrail-route-topology-operation-input.service-information.` " />
-<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$contrail-route-topology-operation-input.allotted-resource-information.` " />
-<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.` " />
-</set><set>
-<parameter name='ar-assignments.' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.`" />
-
-
-
-</set><switch test='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`'>
-
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error assigning contrail route. Source network not found" />
-</return></outcome><outcome value='Other'><block>
-<switch test='`$service-data.networks.network_length`'>
-<outcome value=''>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error assigning contrail route. Source network not found" />
-</return></outcome><outcome value='Other'>
-<block atomic="true"><for index='nidx' start='0' end='`$service-data.networks.network_length`' >
-<switch test="`$service-data.networks.network[$nidx].network-id == $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`">
-
-<outcome value='true'>
-<block>
-<set>
-<parameter name='tmp.ar.tenant-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.tenant`' />
-<parameter name='tmp.ar.cloud-region-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.aic-cloud-region`' />
-
-
-</set><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="tenant"
- key="cloud-region.cloud-owner = 'CloudOwner' AND
- cloud-region.cloud-region-id = $tmp.ar.cloud-region-id AND
- tenant.tenant-id = $tmp.ar.tenant-id"
- pfx='aai.tenant' local-only='false' >
-
-<outcome value='success'>
-<block atomic="true"><set>
-<parameter name='tmp.ar.tenant-name' value='`$aai.tenant.tenant-name`' />
-
-
-</set></block></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="Tenant not found in AAI" />
-
-</return></outcome><outcome value='Other'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Tenant not found in AAI" />
-
-</return></outcome></get-resource></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="Error assigning contrail route. Source network not found" />
-</return></outcome></switch></for></block></outcome></switch></block></outcome></switch><execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
-<parameter name='api-name' value='network-policy' />
-<parameter name='api-action' value='delete' />
-<parameter name='resp-prefix' value='contrailResp' />
-<parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />
-<parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
-
-<outcome value='success'>
-<block>
-</block></outcome><outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Failed to create policy in Contrail" />
-</return></outcome></execute><call module='GENERIC-RESOURCE-API' rpc='policy-manager-delete-policy' mode='sync' >
-<outcome value='failure'>
-<block atomic="true">
-</block></outcome><outcome value='success'>
-<block atomic="true"></block></outcome></call><delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="network-policy"
- key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
-
-
-
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Failed to save network policy in AAI" />
-</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="Failed to save network policy in AAI" />
-</return></outcome></delete><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="allotted-resource"
- key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
- service-subscription.service-type = $service-data.service-information.subscription-service-type AND
- service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
- allotted-resource.id = $tmp.ar.allotted-resource-id"
- pfx='pfx' local-only='false' force='false'>
- <parameter name="operational-status" value="null" />
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="AAI failed" />
-</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="AAI failed" />
-</return></outcome></update><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
- <parameter name="outputPath" value="tmp.current-time" />
-
-</execute><set>
-<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' />
-<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$contrail-route-topology-operation-input.request-information.request-action`' />
-<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`' />
-<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-request-id`' />
-<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
-</set><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='PUT' />
- <parameter name="responsePrefix" value="mdsal-ar" />
-
-<outcome value='success'>
-<block>
-</block></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 updating md-sal for contrail-route-allotted-resource" />
-</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="Error updating md-sal for contrail-route-allotted-resource" />
-</return></outcome></execute><set>
-<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
-<parameter name='contrail-route-object-path' value="`$tmp.ar.self-link`"/>
-<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
- + $contrail-route-topology-operation-input.service-information.service-instance-id
- + '/service-data/service-topology/'`"/>
-
-</set><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>
+<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='contrail-route-topology-operation-delete' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ar.allotted-resource-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+ <parameter name='tmp.ar.parent-service-instance-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+ <parameter name='tmp.ar.sz-vnf-id' value='`$contrail-route-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/contrail-route-topology/'` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name='bk-cr-ar' value='$mdsal-ar.' />
+ </set>
+ <set>
+ <parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' />
+ </set>
+ <switch test='`$ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+ <outcome value='PendingDelete'>
+ <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="`'Existing contrail-route-allotted-resource with order status of ' + $ar.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Contrail Route not found" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Contrail Route not found" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <parameter name='ar.allotted-resource-status.action' value="`$contrail-route-topology-operation-input.request-information.request-action` " />
+ <parameter name='ar.allotted-resource-status.rpc-name' value="contrail-route-topology-operation" />
+ <parameter name='ar.allotted-resource-status.rpc-action' value="`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$contrail-route-topology-operation-input.request-information.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$contrail-route-topology-operation-input.sdnc-request-header.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$contrail-route-topology-operation-input.service-information.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$contrail-route-topology-operation-input.allotted-resource-information.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.` " />
+ </set>
+ <set>
+ <parameter name='ar-assignments.' value="`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.`" />
+ </set>
+ <switch test='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error assigning contrail route. Source network not found" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error assigning contrail route. Source network not found" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='nidx' start='0' end='`$service-data.networks.network_length`' >
+ <switch test="`$service-data.networks.network[$nidx].network-id == $ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.source-network.network-id`">
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.ar.cloud-region-id' value='`$service-data.networks.network[$nidx].network-data.network-topology.aic-cloud-region`' />
+ </set>
+ </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="Error assigning contrail route. Source network not found" />
+ </return>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$tmp.ar.cloud-region-id`' />
+ <parameter name='contrail-network-policy-id' value='`$ar-assignments.contrail-id`' />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to create policy in Contrail" />
+ </return>
+ </outcome>
+ </execute>
+ <call module='GENERIC-RESOURCE-API' rpc='policy-manager-delete-policy' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ </call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-id = $ar-assignments.contrail-id" >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to save network policy in AAI" />
+ </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="Failed to save network policy in AAI" />
+ </return>
+ </outcome>
+ </delete>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="operational-status" value="null" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </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="AAI failed" />
+ </return>
+ </outcome>
+ </update>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$contrail-route-topology-operation-input.request-information.request-action`' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-request-id`' />
+ <parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.cr.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block></block>
+ </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 updating md-sal for contrail-route-allotted-resource" />
+ </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="Error updating md-sal for contrail-route-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+ <parameter name='contrail-route-object-path' value="`$tmp.ar.self-link`"/>
+ <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $contrail-route-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-unassign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-unassign.xml
index d52b2582..e4cbfc27 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-unassign.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation-unassign.xml
@@ -1,121 +1,338 @@
-<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='contrail-route-topology-operation-unassign' mode='sync'>
-<block atomic="true"><set>
-<parameter name='tmp.ar.allotted-resource-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
-<parameter name='tmp.ar.parent-service-instance-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
-<parameter name='tmp.ar.sz-vnf-id' value='`$contrail-route-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' />
-
-
-</set><set>
-<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/'
- + $tmp.ar.allotted-resource-id
- + '/allotted-resource-data/contrail-route-topology/'` " />
-
-</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
- <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
- <parameter name='contextPrefix' value='prop' />
-</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/>
- <parameter name="outputPath" value="tmp.ar-url"/>
- <parameter name="target" value="{allotted-resource-id}"/>
- <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
-</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='GET' />
- <parameter name="responsePrefix" value="mdsal-ar" />
-
-<outcome value='success'>
-<block atomic="true">
-<switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'>
-<outcome value='1'>
-<block atomic='true'>
-<set>
-<parameter name='bk-cr-ar' value='$mdsal-ar.' />
-</set><set>
-<parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' />
-</set><switch test='`$ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
-<outcome value='Created'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message"
- value="`'Existing contrail-route-allotted-resource with order status of ' + $ar.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`" />
-</return></outcome><outcome value='Other'>
-<block>
-</block></outcome></switch><set>
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
-
-</set></block></outcome><outcome value='Other'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="404" />
- <parameter name="error-message" value="Error: Contrail Route not found" />
-
-</return></outcome></switch></block></outcome><outcome value='Other'>
-<block atomic="true">
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="404" />
- <parameter name="error-message" value="Error: Contrail Route not found" />
-
-</return></block></outcome></execute><set>
-<parameter name='ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
-<parameter name='ar.allotted-resource-status.action' value="`$contrail-route-topology-operation-input.request-information.request-action` " />
-<parameter name='ar.allotted-resource-status.rpc-name' value="contrail-route-topology-operation" />
-<parameter name='ar.allotted-resource-status.rpc-action' value="`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` " />
-<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$contrail-route-topology-operation-input.request-information.` " />
-<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$contrail-route-topology-operation-input.sdnc-request-header.` " />
-<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$contrail-route-topology-operation-input.service-information.` " />
-<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$contrail-route-topology-operation-input.allotted-resource-information.` " />
-<parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.` " />
-</set><set>
-<parameter name='contrail-api-output.contrail-id' value="dummycid" />
-</set><set>
-<parameter name='ar-assignments.contrail-id' value="`$contrail-api-output.contrail-id`" />
-
-
-
-</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
- <parameter name="outputPath" value="tmp.current-time" />
-
-</execute><set>
-<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Active' />
-<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$contrail-route-topology-operation-input.request-information.request-action`' />
-<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`' />
-<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$contrail-route-topology-operation-input.sdnc-request-header.svc-request-id`' />
-<parameter name='ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
-</set><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='DELETE' />
- <parameter name="responsePrefix" value="mdsal-ar" />
-
-<outcome value='success'>
-<block>
-</block></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 updating md-sal for contrail-route-allotted-resource" />
-</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="Error updating md-sal for contrail-route-allotted-resource" />
-</return></outcome></execute><set>
-<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
-<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
- + $contrail-route-topology-operation-input.service-information.service-instance-id
- + '/service-data/service-topology/'`"/>
-
-</set><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>
+<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='contrail-route-topology-operation-unassign' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ar.allotted-resource-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+ <parameter name='tmp.ar.parent-service-instance-id' value='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:contrail-route-allotted-resources/contrail-route-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/contrail-route-topology/'` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.cr-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.parent-provided-resource`"/>
+ <parameter name="outputPath" value="tmp.parent-ar-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.parent-ar-url`"/>
+ <parameter name="outputPath" value="tmp.parent-ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.network`"/>
+ <parameter name="outputPath" value="tmp.ar-parentnetwork-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.network-provided-resource`"/>
+ <parameter name="outputPath" value="tmp.network-ar-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$mdsal-ar.contrail-route-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name='bk-cr-ar' value='$mdsal-ar.' />
+ </set>
+ <set>
+ <parameter name='ar.' value='$mdsal-ar.contrail-route-allotted-resource[0].' />
+ </set>
+ <switch test='`$ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+ <outcome value='Created'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Existing contrail-route-allotted-resource with order status of ' + $ar.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Contrail Route not found" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Contrail Route not found" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <parameter name='ar.allotted-resource-status.action' value="`$contrail-route-topology-operation-input.request-information.request-action` " />
+ <parameter name='ar.allotted-resource-status.rpc-name' value="contrail-route-topology-operation" />
+ <parameter name='ar.allotted-resource-status.rpc-action' value="`$contrail-route-topology-operation-input.sdnc-request-header.svc-action` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$contrail-route-topology-operation-input.request-information.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$contrail-route-topology-operation-input.sdnc-request-header.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$contrail-route-topology-operation-input.service-information.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$contrail-route-topology-operation-input.allotted-resource-information.` " />
+ <parameter name='ar.allotted-resource-data.allotted-resource-operation-information.contrail-route-request-input.' value="`$contrail-route-topology-operation-input.contrail-route-request-input.` " />
+ <parameter name='tmp.dest-network-id' value='`$ar.allotted-resource-data.contrail-route-topology.contrail-route-assignments.dest-network.network-id`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="parent" />
+ <outcome value='success'>
+ <block></block>
+ </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 updating md-sal for contrail-route-allotted-resource" />
+ </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="Error updating md-sal for contrail-route-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.network-ar-url`"/>
+ <parameter name="outputPath" value="tmp.network-ar-url"/>
+ <parameter name="target" value="{network-id}"/>
+ <parameter name="replacement" value="`$tmp.dest-network-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="net-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.found-nidx' value='false' />
+ </set>
+ <switch test='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='nidx' start='0' end='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' >
+ <switch test="`$net-ar.network-provided-allotted-resources.network-provided-ar-id[$nidx] == $tmp.ar.allotted-resource-id`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.found-nidx' value='true' />
+ <parameter name='tmp.nidx' value='`$nidx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.found-nidx`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <for silentFailure='true' index='snidx' start='`$tmp.nidx + 1`' end='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.newidx" value="`$snidx - 1`"/>
+ </set>
+ <set>
+ <parameter name="$net-ar.network-provided-allotted-resources.network-provided-ar-id[$tmp.newidx]" value="$net-ar.network-provided-allotted-resources.network-provided-ar-id[$snidx]" />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='net-ar.network-provided-allotted-resources.network-provided-ar-id_length' value='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length - 1`' />
+ </set>
+ <switch test='`$net-ar.network-provided-allotted-resources.network-provided-ar-id_length == 0`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="p-network-ar" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-ar.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.network-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="p-network-ar" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ <for silentFailure='true' index='snidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' >
+ <block atomic="true">
+ <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource[$sdix].allotted-resource-id == $tmp.ar.allotted-resource-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.sdidx" value="`$snidx`"/>
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic="true">
+ <set>
+ <parameter name="service-data.consumed-allotted-resources." value=""/>
+ </set>
+ <set>
+ <parameter name="service-data.consumed-allotted-resources.consumed-allotted-resource_length" value="0"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.new_length" value="`$service-data.consumed-allotted-resources.consumed-allotted-resource_length - 1`"/>
+ </set>
+ <for silentFailure='true' index='snidx' start='`$tmp.sdidx + 1`' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.newidx" value="`$snidx - 1`"/>
+ </set>
+ <set>
+ <parameter name="service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.newidx]." value="$service-data.consumed-allotted-resources.consumed-allotted-resource[$snidx]." />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name="service-data.consumed-allotted-resources.consumed-allotted-resource_length" value="`$service-data.consumed-allotted-resources.consumed-allotted-resource_length - 1`"/>
+ </set>
+ <set>
+ <parameter name="service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.new_length]." value=""/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+ <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $contrail-route-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation.xml
index 478b8509..3b4b87ef 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_contrail-route-topology-operation.xml
@@ -1,26 +1,56 @@
-<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='contrail-route-topology-operation' mode='sync'>
-<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='validate-contrail-route-input' mode='sync' >
-</call><switch test='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`'>
-<outcome value='assign'>
-<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='contrail-route-topology-operation-assign' mode='sync' >
-</call></block></outcome><outcome value='create'>
-<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='contrail-route-topology-operation-create' mode='sync' >
-</call></block></outcome><outcome value='activate'>
-<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='contrail-route-topology-operation-activate' mode='sync' >
-</call></block></outcome><outcome value='deactivate'>
-<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='contrail-route-topology-operation-deactivate' mode='sync' >
-</call></block></outcome><outcome value='delete'>
-<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='contrail-route-topology-operation-delete' mode='sync' >
-</call></block></outcome><outcome value='unassign'>
-<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='contrail-route-topology-operation-unassign' mode='sync' >
-</call></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="sdnc-request-header.svc-action is a required input" />
-</return></outcome></switch><set>
-<parameter name="ack-final" value="Y"/></set><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>
+<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='contrail-route-topology-operation' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-contrail-route-input' mode='sync' ></call>
+ <switch test='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='contrail-route-topology-operation-assign' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='create'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='contrail-route-topology-operation-create' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='activate'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='contrail-route-topology-operation-activate' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='deactivate'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='contrail-route-topology-operation-deactivate' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='delete'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='contrail-route-topology-operation-delete' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='unassign'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='contrail-route-topology-operation-unassign' mode='sync' ></call>
+ </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="sdnc-request-header.svc-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="ack-final" value="Y"/>
+ </set>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_create-l3-subnet.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_create-l3-subnet.xml
index 5000dfdd..c7e34549 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_create-l3-subnet.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_create-l3-subnet.xml
@@ -1,123 +1,192 @@
-<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='create-l3-subnet' mode='sync'>
-<block atomic="true"><set>
-<parameter name='subnet-idx' value='0' />
-</set><switch test='`$tmp.l3-network.level2.v4.entity-id`'>
-<outcome value=''>
-<block atomic="true"><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.create-l3-subnet:REQID"/>
-<parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
-<parameter name="field4" value="tmp.l3-network.level2.v4.entity-id"/>
-<parameter name="field5" value="null"/>
-
-
-
-</record></block></outcome><outcome value='Other'>
-<block atomic="true"><execute plugin="com.att.sdnctl.sli.plugin.ipAddressTools.IpAddressTool" method="getSubnetAddresses">
- <parameter name="ipAddress" value="`$tmp.l3-network.level2.v4.ip-prefix`" />
- <parameter name="ipVersion" value="4" />
- <parameter name="subnet" value="`$tmp.l3-network.level2.v4.mask`" />
- <parameter name="ctxGateway" value="tmp.return.generate.gateway-address" />
- <parameter name="ctxDhcpStart" value="tmp.return.generate.dhcp-start-address" />
- <parameter name="ctxDhcpEnd" value="tmp.return.generate.dhcp-end-address" />
-
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Failed to generate ipv4 addresses using IpAddressTools" /></return></outcome></execute><set>
-<parameter name='tmp.l3-network.subnet[$subnet-idx].orchestration-status' value='PendingCreate' />
-<parameter name='tmp.l3-network.subnet[$subnet-idx].subnet-id' value='`$tmp.l3-network.level2.v4.entity-id`' />
-<parameter name='tmp.l3-network.subnet[$subnet-idx].subnet-name' value="`$tmp.l3-network.network-name + '_S' + $subnet-idx`" />
-<parameter name='tmp.l3-network.subnet[$subnet-idx].gateway-address' value='`$tmp.return.generate.gateway-address`' />
-<parameter name='tmp.l3-network.subnet[$subnet-idx].network-start-address' value='`$tmp.l3-network.level2.v4.ip-prefix`' />
-<parameter name='tmp.l3-network.subnet[$subnet-idx].cidr-mask' value='`$tmp.l3-network.level2.v4.mask`' />
-<parameter name='tmp.l3-network.subnet[$subnet-idx].ip-version' value='`$network-model.ipv4-ip-version`' />
-</set><switch test='`$network-model.ipv4-dhcp-enabled`'>
-<outcome value='Y'>
-<block atomic="true"><set>
-<parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-enabled' value='true' />
-<parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-start' value='`$tmp.return.generate.dhcp-start-address`' />
-<parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-end' value='`$tmp.return.generate.dhcp-end-address`' />
-
-
-</set></block></outcome><outcome value='N'>
-<block atomic="true"><set>
-<parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-enabled' value='false' />
-<parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-start' value='' />
-<parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-end' value='' />
-
-
-</set></block></outcome></switch><set>
-<parameter name='subnet-idx' value='`$subnet-idx+1`' />
-
-</set><set>
-<parameter name='tmp.l3-network.subnet_length' value='`$subnet-idx`' />
-</set></block></outcome></switch><switch test='`$tmp.l3-network.level2.v6.entity-id`'>
-<outcome value=''>
-<block atomic="true"><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.create-l3-subnet:REQID"/>
-<parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
-<parameter name="field4" value="tmp.l3-network.level2.v6.entity-id"/>
-<parameter name="field5" value="null"/>
-
-
-
-</record></block></outcome><outcome value='Other'>
-<block atomic="true"><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.create-l3-subnet:REQID"/>
-<parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
-<parameter name="field4" value="tmp.l3-network.level2.v6.entity-id"/>
-<parameter name="field5" value="`$tmp.l3-network.level2.v6.entity-id`"/>
-
-
-
-</record><execute plugin="com.att.sdnctl.sli.plugin.ipAddressTools.IpAddressTool" method="getSubnetAddresses">
- <parameter name="ipAddress" value="`$tmp.l3-network.level2.v6.ip-prefix`" />
- <parameter name="ipVersion" value="6" />
- <parameter name="subnet" value="`$tmp.l3-network.level2.v6.mask`" />
- <parameter name="ctxGateway" value="tmp.return.generate.gateway-address" />
- <parameter name="ctxDhcpStart" value="tmp.return.generate.dhcp-start-address" />
- <parameter name="ctxDhcpEnd" value="tmp.return.generate.dhcp-end-address" />
-
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Failed to generate ipv6 addresses using IpAddressTools" /></return></outcome></execute><set>
-<parameter name='tmp.l3-network.subnet[$subnet-idx].orchestration-status' value='PendingCreate' />
-<parameter name='tmp.l3-network.subnet[$subnet-idx].subnet-id' value='`$tmp.l3-network.level2.v6.entity-id`' />
-<parameter name='tmp.l3-network.subnet[$subnet-idx].subnet-name' value="`$tmp.l3-network.network-name + '_S' + $subnet-idx`" />
-<parameter name='tmp.l3-network.subnet[$subnet-idx].gateway-address' value='`$tmp.return.generate.gateway-address`' />
-<parameter name='tmp.l3-network.subnet[$subnet-idx].network-start-address' value='`$tmp.l3-network.level2.v6.ip-prefix`' />
-<parameter name='tmp.l3-network.subnet[$subnet-idx].cidr-mask' value='`$tmp.l3-network.level2.v6.mask`' />
-<parameter name='tmp.l3-network.subnet[$subnet-idx].ip-version' value='`$network-model.ipv6-ip-version`' />
-
-
-</set><switch test='`$network-model.ipv6-dhcp-enabled`'>
-<outcome value='Y'>
-<block atomic="true"><set>
-<parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-enabled' value='true' />
-<parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-start' value='`$tmp.return.generate.dhcp-start-address`' />
-<parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-end' value='`$tmp.return.generate.dhcp-end-address`' />
-
-
-</set></block></outcome><outcome value='N'>
-<block atomic="true"><set>
-<parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-enabled' value='false' />
-<parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-start' value='' />
-<parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-end' value='' />
-
-
-</set></block></outcome></switch><set>
-<parameter name='subnet-idx' value='`$subnet-idx+1`' />
-</set><set>
-<parameter name='tmp.l3-network.subnet_length' value='`$subnet-idx`' />
-</set></block></outcome></switch><return status='success'>
-<parameter name='' value='' />
-</return></block></method></service-logic>
+<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='create-l3-subnet' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='subnet-idx' value='0' />
+ </set>
+ <switch test='`$v4.entity-id`'>
+ <outcome value=''>
+ <block atomic="true">
+ <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.create-l3-subnet:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="v4.entity-id"/>
+ <parameter name="field5" value="null"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <switch test='`$network-model.ipv4-dhcp-enabled`'>
+ <outcome value='Y'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ipv4dhcp-enabled' value='true' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='N'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ipv4dhcp-enabled' value='false' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin="com.att.sdnctl.sli.plugin.ipAddressTools.IpAddressTool" method="getSubnetAddresses">
+ <parameter name="ipAddress" value="`$v4.ip-prefix`" />
+ <parameter name="ipVersion" value="4" />
+ <parameter name="subnet" value="`$v4.mask`" />
+ <parameter name="dhcp-enabled" value="`$tmp.ipv4dhcp-enabled`" />
+ <parameter name="ctxGateway" value="tmp.return.generate.gateway-address" />
+ <parameter name="ctxDhcpStart" value="tmp.return.generate.dhcp-start-address" />
+ <parameter name="ctxDhcpEnd" value="tmp.return.generate.dhcp-end-address" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to generate ipv4 addresses using IpAddressTools" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].orchestration-status' value='PendingCreate' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].subnet-id' value='`$v4.entity-id`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].subnet-name' value="`$tmp.l3-network.network-name + '_S' + $subnet-idx`" />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].gateway-address' value='`$tmp.return.generate.gateway-address`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].network-start-address' value='`$v4.ip-prefix`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].cidr-mask' value='`$v4.mask`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].ip-version' value='`$network-model.ipv4-ip-version`' />
+ </set>
+ <switch test='`$network-model.ipv4-dhcp-enabled`'>
+ <outcome value='Y'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-enabled' value='true' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-start' value='`$tmp.return.generate.dhcp-start-address`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-end' value='`$tmp.return.generate.dhcp-end-address`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='N'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-enabled' value='false' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-start' value='' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-end' value='' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='subnet-idx' value='`$subnet-idx+1`' />
+ </set>
+ <set>
+ <parameter name='tmp.l3-network.subnet_length' value='`$subnet-idx`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$v6.entity-id`'>
+ <outcome value=''>
+ <block atomic="true">
+ <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.create-l3-subnet:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="v6.entity-id"/>
+ <parameter name="field5" value="null"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <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.create-l3-subnet:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="v6.entity-id"/>
+ <parameter name="field5" value="`$v6.entity-id`"/>
+ </record>
+ <switch test='`$network-model.ipv6-dhcp-enabled`'>
+ <outcome value='Y'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ipv6dhcp-enabled' value='true' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='N'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ipv6dhcp-enabled' value='false' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin="com.att.sdnctl.sli.plugin.ipAddressTools.IpAddressTool" method="getSubnetAddresses">
+ <parameter name="ipAddress" value="`$v6.ip-prefix`" />
+ <parameter name="ipVersion" value="6" />
+ <parameter name="subnet" value="`$v6.mask`" />
+ <parameter name="dhcp-enabled" value="`$tmp.ipv6dhcp-enabled`" />
+ <parameter name="ctxGateway" value="tmp.return.generate.gateway-address" />
+ <parameter name="ctxDhcpStart" value="tmp.return.generate.dhcp-start-address" />
+ <parameter name="ctxDhcpEnd" value="tmp.return.generate.dhcp-end-address" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to generate ipv6 addresses using IpAddressTools" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].orchestration-status' value='PendingCreate' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].subnet-id' value='`$v6.entity-id`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].subnet-name' value="`$tmp.l3-network.network-name + '_S' + $subnet-idx`" />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].gateway-address' value='`$tmp.return.generate.gateway-address`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].network-start-address' value='`$v6.ip-prefix`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].cidr-mask' value='`$v6.mask`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].ip-version' value='`$network-model.ipv6-ip-version`' />
+ </set>
+ <switch test='`$network-model.ipv6-dhcp-enabled`'>
+ <outcome value='Y'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-enabled' value='true' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-start' value='`$tmp.return.generate.dhcp-start-address`' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-end' value='`$tmp.return.generate.dhcp-end-address`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='N'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-enabled' value='false' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-start' value='' />
+ <parameter name='tmp.l3-network.subnet[$subnet-idx].dhcp-end' value='' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='subnet-idx' value='`$subnet-idx+1`' />
+ </set>
+ <set>
+ <parameter name='tmp.l3-network.subnet_length' value='`$subnet-idx`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_create-route-target-and-vpn-binding.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_create-route-target-and-vpn-binding.xml
new file mode 100755
index 00000000..f9866fe8
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_create-route-target-and-vpn-binding.xml
@@ -0,0 +1,437 @@
+<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='create-route-target-and-vpn-binding' mode='sync'>
+ <block atomic="true">
+ <switch test='`$rt.aic-zone`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error missing parameters to create-local-route-target" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$rt.resource`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error missing parameters to create-local-route-target" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$rt.resource-value`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error missing parameters to create-local-route-target" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$rt.network-name`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error missing parameters to create-local-route-target" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$rt.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error missing parameters to create-local-route-target" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$rt.network-instance-group-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error missing parameters to create-local-route-target" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$rt.network-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error missing parameters to create-local-route-target" />
+ </return>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.network-instance-group-vpn-binding`"/>
+ <parameter name="outputPath" value="tmp.vpn-binding-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$rt.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.vpn-binding-url`"/>
+ <parameter name="outputPath" value="tmp.vpn-binding-url"/>
+ <parameter name="target" value="{network-instance-group-id}"/>
+ <parameter name="replacement" value="`$rt.network-instance-group-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.vpn-binding-url`"/>
+ <parameter name="outputPath" value="tmp.vpn-binding-url"/>
+ <parameter name="target" value="{network-id}"/>
+ <parameter name="replacement" value="`$rt.network-id`"/>
+ </execute>
+ <set>
+ <parameter name="get-data-from-policy-input.policy-instance-name" value="`$get-complex-resource-service-model-output.vpn-binding-policy`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='get-data-from-policy' mode='sync' ></call>
+ <set>
+ <parameter name="vpn-binding.vpn-name" value="`$rt.network-name`" />
+ <parameter name="vpn-binding.asn" value="`$get-data-from-policy-output.asn`" />
+ <parameter name="vpn-binding.route-target-role" value="`$get-data-from-policy-output.route-target-role`" />
+ <parameter name="vpn-binding.aic-zone" value="`$rt.aic-zone`" />
+ <parameter name="vpn-binding.route-target-category" value="local" />
+ <parameter name="vpn-binding.resource" value="`$rt.resource`" />
+ <parameter name="vpn-binding.resource-value" value="`$rt.resource-value`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-vpn-binding-id' mode='sync' ></call>
+ <set>
+ <parameter name='vpn-binding.vpn-binding-id' value='`$tmp.return.generate-vpn-binding-id.uuid`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.vpn-binding-url`"/>
+ <parameter name="outputPath" value="tmp.vpn-binding-url"/>
+ <parameter name="target" value="{vpn-binding-id}"/>
+ <parameter name="replacement" value="`$vpn-binding.vpn-binding-id`"/>
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-binding.vpn-id = $vpn-binding.vpn-binding-id" >
+ <parameter name="vpn-id" value="`$vpn-binding.vpn-binding-id`" />
+ <parameter name="vpn-name" value="`$vpn-binding.vpn-name`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error creating vpn-binding in AAI" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error creating vpn-binding in AAI" />
+ </return>
+ </outcome>
+ </save>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.rt.microservice.url + $prop.restapi.mS.allocateRT`' />
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.rtmS.allocateRT.templatefile`" />
+ <parameter name='restapiUser' value='`$prop.rt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.rt.mS.pwd`' />
+ <parameter name='customHttpHeaders' value='x-UserId=SDNCP' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="msRT" />
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$msRT.responseCode`'>
+ <outcome value='200'></outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Error: calling allocate resource microservice - responseCode: ' + $msRT.responseCode + ' responseMsg: ' + $msRT.responseMessage + ' allocateRouteTargetStatus: ' + $msRT.allocateRouteTargetStatus `"/>
+ </set>
+ <block atomic='true'>
+ <switch test="`$vpn-binding.global-route-target != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.rt.microservice.url + $prop.restapi.mS.releaseRT`' />
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.rtmS.allocateRT.templatefile`" />
+ <parameter name='restapiUser' value='`$prop.rt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.rt.mS.pwd`' />
+ <parameter name='customHttpHeaders' value='x-UserId=SDNCP' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="msRT" />
+ </execute>
+ </outcome>
+ </switch>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-id = $rt.vpn-id"></delete>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-instance-group-vpn-binding.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vpn-binding-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-vpn-binding" />
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to vpn binding - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error: calling allocate resource microservice"/>
+ </set>
+ <block atomic='true'>
+ <switch test="`$vpn-binding.global-route-target != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.rt.microservice.url + $prop.restapi.mS.releaseRT`' />
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.rtmS.allocateRT.templatefile`" />
+ <parameter name='restapiUser' value='`$prop.rt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.rt.mS.pwd`' />
+ <parameter name='customHttpHeaders' value='x-UserId=SDNCP' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="msRT" />
+ </execute>
+ </outcome>
+ </switch>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-id = $rt.vpn-id"></delete>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-instance-group-vpn-binding.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vpn-binding-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-vpn-binding" />
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to vpn binding - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name="vpn-binding.global-route-target" value="`$msRT.routeTargetID`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-instance-group-vpn-binding.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vpn-binding-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-vpn-binding" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error: failed to save vpn-binding in md-sal" />
+ </set>
+ <block atomic='true'>
+ <switch test="`$vpn-binding.global-route-target != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.rt.microservice.url + $prop.restapi.mS.releaseRT`' />
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.rtmS.allocateRT.templatefile`" />
+ <parameter name='restapiUser' value='`$prop.rt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.rt.mS.pwd`' />
+ <parameter name='customHttpHeaders' value='x-UserId=SDNCP' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="msRT" />
+ </execute>
+ </outcome>
+ </switch>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-id = $rt.vpn-id"></delete>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-instance-group-vpn-binding.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vpn-binding-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-vpn-binding" />
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to vpn binding - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error: failed to save vpn-binding in md-sal" />
+ </set>
+ <block atomic='true'>
+ <switch test="`$vpn-binding.global-route-target != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.rt.microservice.url + $prop.restapi.mS.releaseRT`' />
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.rtmS.allocateRT.templatefile`" />
+ <parameter name='restapiUser' value='`$prop.rt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.rt.mS.pwd`' />
+ <parameter name='customHttpHeaders' value='x-UserId=SDNCP' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="msRT" />
+ </execute>
+ </outcome>
+ </switch>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-id = $rt.vpn-id"></delete>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-instance-group-vpn-binding.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vpn-binding-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-vpn-binding" />
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to vpn binding - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="route-target"
+ key="vpn-binding.vpn-binding-id = $vpn-binding.vpn-binding-id
+ AND route-target.global-route-target = $vpn-binding.global-route-target
+ AND route-target.route-target-role = $vpn-binding.route-target-role" >
+ <!-- Create route-target object -->
+ <parameter name="global-route-target" value="`$vpn-binding.global-route-target`" />
+ <parameter name="route-target-role" value="`$vpn-binding.route-target-role`" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error: failed to save route target in AAI"/>
+ </set>
+ <block atomic='true'>
+ <switch test="`$vpn-binding.global-route-target != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.rt.microservice.url + $prop.restapi.mS.releaseRT`' />
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.rtmS.allocateRT.templatefile`" />
+ <parameter name='restapiUser' value='`$prop.rt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.rt.mS.pwd`' />
+ <parameter name='customHttpHeaders' value='x-UserId=SDNCP' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="msRT" />
+ </execute>
+ </outcome>
+ </switch>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-id = $rt.vpn-id"></delete>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-instance-group-vpn-binding.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vpn-binding-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-vpn-binding" />
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to vpn binding - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error: failed to save route target in AAI"/>
+ </set>
+ <block atomic='true'>
+ <switch test="`$vpn-binding.global-route-target != ''`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.rt.microservice.url + $prop.restapi.mS.releaseRT`' />
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.rtmS.allocateRT.templatefile`" />
+ <parameter name='restapiUser' value='`$prop.rt.mS.user`' />
+ <parameter name='restapiPassword' value='`$prop.rt.mS.pwd`' />
+ <parameter name='customHttpHeaders' value='x-UserId=SDNCP' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="msRT" />
+ </execute>
+ </outcome>
+ </switch>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-id = $rt.vpn-id"></delete>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-instance-group-vpn-binding.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vpn-binding-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-vpn-binding" />
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to vpn binding - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_eipam-allocate-generic-subnet.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_eipam-allocate-generic-subnet.xml
new file mode 100755
index 00000000..1e6c8bb9
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_eipam-allocate-generic-subnet.xml
@@ -0,0 +1,1127 @@
+<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='eipam-allocate-generic-subnet' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.eipam-error" value="false" />
+ <parameter name="tmp.allocate-v4-subnet-flag" value="N" />
+ <parameter name="tmp.allocate-v6-subnet-flag" value="N" />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ <parameter name="eipam-pool.v4.pre-existing" value="N"/>
+ <parameter name="eipam-pool.v6.pre-existing" value="N"/>
+ <parameter name="tmp.leaf-level" value="N" />
+ </set>
+ <switch test="`$tmp.activate-subnet-flag`">
+ <outcome value="">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.activate-subnet-flag" value="Y"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Y'></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <switch test="`$eipam-ip-block.level == $eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.leaf-level" value="Y" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <!--Need to know which ipv version to get the plan name from the network-model.-->
+ <switch test="`$eipam-ip-block.allocate-version`">
+ <outcome value='ipv4'>
+ <block atomic='true'>
+ <switch test="`$l-idx`">
+ <outcome value='1'>
+ <block atomic='true'>
+ <switch test="`$tmp.skip-first-level`">
+ <outcome value='Y'></outcome>
+ <outcome value="">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="`$tmp.activate-subnet-flag`"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="`$tmp.leaf-level`"/>
+ <parameter name="tmp.allocate-v4-subnet-flag" value="Y" />
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <for index="l4-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.pools[$l4-idx].key-name" value="`$v4FQPN-output.pools[$l4-idx].key-name`"/>
+ <parameter name="eipam-ip-block.pools[$l4-idx].key-value" value="`$v4FQPN-output.pools[$l4-idx].key-value`"/>
+ </set>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$eipam-ip-block.plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.pools[$l4-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.pools[$l4-idx].key-value`"/>
+ </record>
+ </block>
+ </for>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v4-address-plan and level = $eipam-ip-block.level and key_value = $tmp.key-value ; "
+ pfx='pfx.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test="`$network-instance-group-data.subnet-assignment-policy.subnet-use`">
+ <outcome value='shared'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ,
+ network_instance_group_id = $tmp.network-instance-group-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value=''>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-key-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$key-value`"/>
+ <parameter name="field6" value="`$tmp.eipam-pool-row.pool-id`"/>
+ <parameter name="field7" value="`$tmp.network_instance_group_id`"/>
+ <parameter name="field8" value="`$eipam-ip-block.level`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="subnet saved to DB."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='N'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="`$tmp.activate-subnet-flag`"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="`$tmp.leaf-level`"/>
+ <parameter name="tmp.allocate-v4-subnet-flag" value="Y" />
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <for index="l4-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.pools[$l4-idx].key-name" value="`$v4FQPN-output.pools[$l4-idx].key-name`"/>
+ <parameter name="eipam-ip-block.pools[$l4-idx].key-value" value="`$v4FQPN-output.pools[$l4-idx].key-value`"/>
+ </set>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$eipam-ip-block.plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.pools[$l4-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.pools[$l4-idx].key-value`"/>
+ </record>
+ </block>
+ </for>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v4-address-plan and level = $eipam-ip-block.level and key_value = $tmp.key-value ; "
+ pfx='pfx.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test="`$network-instance-group-data.subnet-assignment-policy.subnet-use`">
+ <outcome value='shared'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ,
+ network_instance_group_id = $tmp.network-instance-group-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value=''>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-key-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$key-value`"/>
+ <parameter name="field6" value="`$tmp.eipam-pool-row.pool-id`"/>
+ <parameter name="field7" value="`$tmp.network_instance_group_id`"/>
+ <parameter name="field8" value="`$eipam-ip-block.level`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="subnet saved to DB."/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="`$tmp.activate-subnet-flag`"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="`$tmp.leaf-level`"/>
+ <parameter name="tmp.allocate-v4-subnet-flag" value="Y" />
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <for index="l4-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.pools[$l4-idx].key-name" value="`$v4FQPN-output.pools[$l4-idx].key-name`"/>
+ <parameter name="eipam-ip-block.pools[$l4-idx].key-value" value="`$v4FQPN-output.pools[$l4-idx].key-value`"/>
+ </set>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$eipam-ip-block.plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.pools[$l4-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.pools[$l4-idx].key-value`"/>
+ </record>
+ </block>
+ </for>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v4-address-plan and level = $eipam-ip-block.level and key_value = $tmp.key-value ; "
+ pfx='pfx.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test="`$network-instance-group-data.subnet-assignment-policy.subnet-use`">
+ <outcome value='shared'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ,
+ network_instance_group_id = $tmp.network-instance-group-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value=''>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-key-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$key-value`"/>
+ <parameter name="field6" value="`$tmp.eipam-pool-row.pool-id`"/>
+ <parameter name="field7" value="`$tmp.network_instance_group_id`"/>
+ <parameter name="field8" value="`$eipam-ip-block.level`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="subnet saved to DB."/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='ipv6'>
+ <block atomic='true'>
+ <switch test="`$l-idx`">
+ <outcome value='1'>
+ <block atomic='true'>
+ <switch test="`$tmp.skip-first-level`">
+ <outcome value='Y'></outcome>
+ <outcome value="">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="`$tmp.activate-subnet-flag`"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="`$tmp.leaf-level`"/>
+ <parameter name="tmp.allocate-v6-subnet-flag" value="Y" />
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <for index="l6-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.pools[$l6-idx].key-name" value="`$v6FQPN-output.pools[$l6-idx].key-name`"/>
+ <parameter name="eipam-ip-block.pools[$l6-idx].key-value" value="`$v6FQPN-output.pools[$l6-idx].key-value`"/>
+ </set>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$eipam-ip-block.plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.pools[$l6-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.pools[$l6-idx].key-value`"/>
+ <parameter name="field7" value="`$l6-idx`"/>
+ </record>
+ </block>
+ </for>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v6-address-plan and level = $eipam-ip-block.level and key_value = $tmp.key-value ; "
+ pfx='pfx.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test="`$network-instance-group-data.subnet-assignment-policy.subnet-use`">
+ <outcome value='shared'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ,
+ network_instance_group_id = $tmp.network-instance-group-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value=''>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-key-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="field5" value="`$key-value`"/>
+ <parameter name="field6" value="`$tmp.eipam-pool-row.pool-id`"/>
+ <parameter name="field7" value="`$tmp.network_instance_group_id`"/>
+ <parameter name="field8" value="`$eipam-ip-block.level`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="subnet info are saved to DB."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='N'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="`$tmp.activate-subnet-flag`"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="`$tmp.leaf-level`"/>
+ <parameter name="tmp.allocate-v6-subnet-flag" value="Y" />
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <for index="l6-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.pools[$l6-idx].key-name" value="`$v6FQPN-output.pools[$l6-idx].key-name`"/>
+ <parameter name="eipam-ip-block.pools[$l6-idx].key-value" value="`$v6FQPN-output.pools[$l6-idx].key-value`"/>
+ </set>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$eipam-ip-block.plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.pools[$l6-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.pools[$l6-idx].key-value`"/>
+ <parameter name="field7" value="`$l6-idx`"/>
+ </record>
+ </block>
+ </for>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v6-address-plan and level = $eipam-ip-block.level and key_value = $tmp.key-value ; "
+ pfx='pfx.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test="`$network-instance-group-data.subnet-assignment-policy.subnet-use`">
+ <outcome value='shared'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ,
+ network_instance_group_id = $tmp.network-instance-group-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value=''>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-key-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="field5" value="`$key-value`"/>
+ <parameter name="field6" value="`$tmp.eipam-pool-row.pool-id`"/>
+ <parameter name="field7" value="`$tmp.network_instance_group_id`"/>
+ <parameter name="field8" value="`$eipam-ip-block.level`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="subnet info are saved to DB."/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="`$tmp.activate-subnet-flag`"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="`$tmp.leaf-level`"/>
+ <parameter name="tmp.allocate-v6-subnet-flag" value="Y" />
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <for index="l6-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.pools[$l6-idx].key-name" value="`$v6FQPN-output.pools[$l6-idx].key-name`"/>
+ <parameter name="eipam-ip-block.pools[$l6-idx].key-value" value="`$v6FQPN-output.pools[$l6-idx].key-value`"/>
+ </set>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$eipam-ip-block.plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.pools[$l6-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.pools[$l6-idx].key-value`"/>
+ <parameter name="field7" value="`$l6-idx`"/>
+ </record>
+ </block>
+ </for>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v6-address-plan and level = $eipam-ip-block.level and key_value = $tmp.key-value ; "
+ pfx='pfx.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test="`$network-instance-group-data.subnet-assignment-policy.subnet-use`">
+ <outcome value='shared'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ,
+ network_instance_group_id = $tmp.network-instance-group-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value=''>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ACTIVE' ,
+ pool_id = $pfx.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ; "
+ force='true'
+ pfx='pfx.eipam-v6subnet-key-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-generic-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="field5" value="`$key-value`"/>
+ <parameter name="field6" value="`$tmp.eipam-pool-row.pool-id`"/>
+ <parameter name="field7" value="`$tmp.network_instance_group_id`"/>
+ <parameter name="field8" value="`$eipam-ip-block.level`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="subnet info are saved to DB."/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.allocate-version for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="error-code" value="200" />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_eipam-allocate-network-role-subnet.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_eipam-allocate-network-role-subnet.xml
index fb62d6d5..8fd63766 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_eipam-allocate-network-role-subnet.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_eipam-allocate-network-role-subnet.xml
@@ -1,47 +1,75 @@
-<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='eipam-allocate-network-role-subnet' mode='sync'>
-<block atomic='true'><set>
- <parameter name="tmp.eipam-error" value="false" />
- <parameter name="eipam-ip-block.ip-prefix" value='' />
- <parameter name="eipam-ip-block.mask" value='' />
- <parameter name="pfx.eipam-pool-row" value='' />
- <parameter name="tmp.level1-key-name" value="CLLI:CLOUD_REGION" />
- <parameter name="tmp.level2-key-name" value="NETWORK_ROLE:NETWORK_ID" /></set><!--Need to know which ipv version to get the plan name from the network-model.--><switch test="`$eipam-ip-block.allocate-version`"><outcome value='ipv4'><block atomic='true'><switch test="`$eipam-ip-block.level`"><outcome value='1'><block atomic='true'><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><set>
- <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v4-address-plan`"/>
- <parameter name="eipam-ip-block.activate-subnet-flag" value="Y"/>
- <parameter name="eipam-ip-block.leaf-level-indicator" value="N"/>
- <!-- Number of Pool Levels -->
- <parameter name="eipam-ip-block.pools_length" value="1"/>
-
- <!-- Level 1 -->
- <parameter name="eipam-ip-block.pools[0].key-name" value="`$tmp.level1-key-name`"/>
- <parameter name="eipam-ip-block.pools[0].key-value" value="`$tmp.level1-key-value`"/></set><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
-<outcome value='failure'><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while allocating V4 subnet in EIPAM." />
- </return></outcome></execute><get-resource
+<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='eipam-allocate-network-role-subnet' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.eipam-error" value="false" />
+ <parameter name="eipam-ip-block.ip-prefix" value='' />
+ <parameter name="eipam-ip-block.mask" value='' />
+ <parameter name="pfx.eipam-pool-row" value='' />
+ <parameter name="tmp.level1-key-name" value="LOCATION_CLLI8:CLOUD_REGION_ID" />
+ <parameter name="tmp.level2-key-name" value="NETWORK_ROLE:NETWORK_ID" />
+ </set>
+ <!--Need to know which ipv version to get the plan name from the network-model.-->
+ <switch test="`$eipam-ip-block.allocate-version`">
+ <outcome value='ipv4'>
+ <block atomic='true'>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value='1'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="Y"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="N"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="1"/>
+ <!-- Level 1 -->
+ <parameter name="eipam-ip-block.pools[0].key-name" value="`$tmp.level1-key-name`"/>
+ <parameter name="eipam-ip-block.pools[0].key-value" value="`$tmp.level1-key-value`"/>
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v4-address-plan and level = 1 and key_value = $tmp.level1-key-value ; "
pfx='pfx.eipam-pool-row'>
-
-<outcome value='failure'><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
- </return></outcome><outcome value="not-found"><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
- </return></outcome></get-resource><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="network-topology-operation"/>
-<parameter name="field3" value="eipam-allocate-network-role-subnet"/>
-<parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
-<parameter name="field5" value="`$tmp.level1-key-value`"/>
-<parameter name="field6" value="`$tmp.eipam-pool-row.pool-id`"/>
-<parameter name="field7" value="Level 1 subnet saved to DB."/></record><save
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-network-role-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$tmp.level1-key-value`"/>
+ <parameter name="field6" value="`$tmp.eipam-pool-row.pool-id`"/>
+ <parameter name="field7" value="Level 1 subnet saved to DB."/>
+ </record>
+ <save
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="INSERT EIPAM_IP_SUBNETS
@@ -57,11 +85,15 @@
network_id = $tmp.network-id ; "
force='true'
pfx='pfx.eipam-v4subnet-row'>
-<outcome value='failure'><return status='failure'>
-<parameter name='error-code' value='500' />
-<parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
-</return></outcome><outcome value='success'>
-</outcome></save><save
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="INSERT EIPAM_IP_SUBNET_KEYS
@@ -72,56 +104,82 @@
level = 1 ; "
force='true'
pfx='pfx.eipam-v4subnet-key-row'>
-<outcome value='failure'><return status='failure'>
-<parameter name='error-code' value='500' />
-<parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
-</return></outcome><outcome value='success'>
-</outcome></save></block></outcome><outcome value='2'><block atomic='true'><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><set>
- <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v4-address-plan`"/>
- <parameter name="eipam-ip-block.activate-subnet-flag" value="N"/>
- <parameter name="eipam-ip-block.leaf-level-indicator" value="Y"/>
-
- <!-- Number of Pool Levels -->
- <parameter name="eipam-ip-block.pools_length" value="2"/>
-
- <!-- Level 1 -->
- <parameter name="eipam-ip-block.pools[0].key-name" value="`$tmp.level1-key-name`"/>
- <parameter name="eipam-ip-block.pools[0].key-value" value="`$tmp.level1-key-value`"/>
-
- <!-- Level 2 -->
- <parameter name="eipam-ip-block.pools[1].key-name" value="`$tmp.level2-key-name`"/>
- <parameter name="eipam-ip-block.pools[1].key-value" value="`$tmp.level2-key-value`"/></set><switch test="`$eipam-ip-block.subnet-size-override`"><outcome value=''>
-<block atomic='true'><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="network-topology-operation"/>
-<parameter name="field3" value="eipam-allocate-network-role-subnet"/>
-<parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
-<parameter name="field5" value="`$tmp.level2-key-value`"/>
-<parameter name="field6" value="Level 2 subnet override not set, default to network model value."/>
-
-</record><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><set>
- <parameter name="eipam-ip-block.subnet-size-override" value="`$network-model.ipv4-cidr-mask`" />
-</set></block></outcome></switch><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
-<outcome value='failure'><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while allocating V4 subnet in EIPAM." />
- </return></outcome></execute><get-resource
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='2'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="N"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="Y"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="2"/>
+ <!-- Level 1 -->
+ <parameter name="eipam-ip-block.pools[0].key-name" value="`$tmp.level1-key-name`"/>
+ <parameter name="eipam-ip-block.pools[0].key-value" value="`$tmp.level1-key-value`"/>
+ <!-- Level 2 -->
+ <parameter name="eipam-ip-block.pools[1].key-name" value="`$tmp.level2-key-name`"/>
+ <parameter name="eipam-ip-block.pools[1].key-value" value="`$tmp.level2-key-value`"/>
+ </set>
+ <switch test="`$eipam-ip-block.subnet-size-override`">
+ <outcome value=''>
+ <block atomic='true'>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-network-role-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$tmp.level2-key-value`"/>
+ <parameter name="field6" value="Level 2 subnet override not set, default to network model value."/>
+ </record>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.subnet-size-override" value="`$network-model.ipv4-cidr-mask`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v4-address-plan and level = 2 and parent_pool = $tmp.level1-key-value AND key_value = $tmp.level2-key-value ; "
pfx='pfx.eipam-pool-row'>
-
-<outcome value='failure'><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
- </return></outcome><outcome value="not-found"><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
- </return></outcome></get-resource><save
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <save
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="INSERT EIPAM_IP_SUBNETS
@@ -137,11 +195,15 @@
network_id = $tmp.network-id ; "
force='true'
pfx='pfx.eipam-subnet-row'>
-<outcome value='failure'><return status='failure'>
-<parameter name='error-code' value='500' />
-<parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
-</return></outcome><outcome value='success'>
-</outcome></save><save
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="INSERT EIPAM_IP_SUBNET_KEYS
@@ -152,11 +214,15 @@
level = 1 ; "
force='true'
pfx='pfx.eipam-v4subnet-key-row'>
-<outcome value='success'>
-</outcome><outcome value='failure'><return status='failure'>
-<parameter name='error-code' value='500' />
-<parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
-</return></outcome></save><save
+ <outcome value='success'></outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ </save>
+ <save
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="INSERT EIPAM_IP_SUBNET_KEYS
@@ -167,54 +233,89 @@
level = 2 ; "
force='true'
pfx='pfx.eipam-v4subnet-key-row'>
-<outcome value='success'>
-</outcome><outcome value='failure'><return status='failure'>
-<parameter name='error-code' value='500' />
-<parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
-</return></outcome></save><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="network-topology-operation"/>
-<parameter name="field3" value="eipam-allocate-network-role-subnet"/>
-<parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
-<parameter name="field5" value="`$tmp.level1-key-value`"/>
-
-<!-- Level 2 -->
- <parameter name="field6" value="NETWORK_ROLE_NETWORK_ID"/>
- <parameter name="field7" value="`$tmp.level2-key-value`"/>
-<parameter name="field8" value="Level 2 subnet saved to DB."/></record></block></outcome><outcome value=''><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
- </return></outcome></switch></block></outcome><outcome value='ipv6'><block atomic='true'><switch test="`$eipam-ip-block.level`"><outcome value='1'><block atomic='true'><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><set>
- <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v6-address-plan`"/>
- <parameter name="eipam-ip-block.activate-subnet-flag" value="Y"/>
- <parameter name="eipam-ip-block.leaf-level-indicator" value="N"/>
- <!-- Number of Pool Levels -->
- <parameter name="eipam-ip-block.pools_length" value="1"/>
-
- <!-- Level 1 -->
- <parameter name="eipam-ip-block.pools[0].key-name" value="`$tmp.level1-key-name`"/>
- <parameter name="eipam-ip-block.pools[0].key-value" value="`$tmp.level1-key-value`"/></set><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
-<outcome value='failure'><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while allocating V4 subnet in EIPAM." />
- </return></outcome></execute><get-resource
+ <outcome value='success'></outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ </save>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.subnet-size-override" value='' />
+ </set>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-network-role-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$tmp.level1-key-value`"/>
+ <!-- Level 2 -->
+ <parameter name="field6" value="NETWORK_ROLE_NETWORK_ID"/>
+ <parameter name="field7" value="`$tmp.level2-key-value`"/>
+ <parameter name="field8" value="Level 2 subnet saved to DB."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='ipv6'>
+ <block atomic='true'>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value='1'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="Y"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="N"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="1"/>
+ <!-- Level 1 -->
+ <parameter name="eipam-ip-block.pools[0].key-name" value="`$tmp.level1-key-name`"/>
+ <parameter name="eipam-ip-block.pools[0].key-value" value="`$tmp.level1-key-value`"/>
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v6-address-plan and level = 1 and key_value = $tmp.level1-key-value ; "
pfx='pfx.eipam-pool-row'>
-
-<outcome value='failure'><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
- </return></outcome><outcome value="not-found"><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
- </return></outcome></get-resource><save
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <save
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="INSERT EIPAM_IP_SUBNETS
@@ -230,11 +331,15 @@
network_id = $tmp.network-id ; "
force='true'
pfx='pfx.eipam-v6subnet-row'>
-<outcome value='failure'><return status='failure'>
-<parameter name='error-code' value='500' />
-<parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
-</return></outcome><outcome value='success'>
-</outcome></save><save
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="INSERT EIPAM_IP_SUBNET_KEYS
@@ -245,64 +350,92 @@
level = 1 ; "
force='true'
pfx='pfx.eipam-v6subnet-key-row'>
-<outcome value='failure'><return status='failure'>
-<parameter name='error-code' value='500' />
-<parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
-</return></outcome><outcome value='success'>
-</outcome></save><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="network-topology-operation"/>
-<parameter name="field3" value="eipam-allocate-network-role-subnet"/>
-<parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
-<parameter name="field5" value="`$tmp.level1-key-value`"/>
-<parameter name="field6" value="`$tmp.eipam-pool-row.pool-id`"/>
-<parameter name="field7" value="Level 1 subnet saved to DB."/></record></block></outcome><outcome value='2'><block atomic='true'><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><set>
- <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v6-address-plan`"/>
- <parameter name="eipam-ip-block.activate-subnet-flag" value="N"/>
- <parameter name="eipam-ip-block.leaf-level-indicator" value="Y"/>
-
- <!-- Number of Pool Levels -->
- <parameter name="eipam-ip-block.pools_length" value="2"/>
-
- <!-- Level 1 -->
- <parameter name="eipam-ip-block.pools[0].key-name" value="`$tmp.level1-key-name`"/>
- <parameter name="eipam-ip-block.pools[0].key-value" value="`$tmp.level1-key-value`"/>
-
- <!-- Level 2 -->
- <parameter name="eipam-ip-block.pools[1].key-name" value="`$tmp.level2-key-name`"/>
- <parameter name="eipam-ip-block.pools[1].key-value" value="`$tmp.level2-key-value`"/></set><switch test="`$eipam-ip-block.subnet-size-override`"><outcome value=''>
-<block atomic='true'><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="network-topology-operation"/>
-<parameter name="field3" value="eipam-allocate-network-role-subnet"/>
-<parameter name="field4" value="`$network-model.eipam-v6-address-plan`"/>
-<parameter name="field5" value="`$tmp.level2-key-value`"/>
-<parameter name="field6" value="Level 2 subnet override not set, default to network model value."/>
-
-</record><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><set>
- <parameter name="eipam-ip-block.subnet-size-override" value="`$network-model.ipv6-cidr-mask`" />
-</set></block></outcome></switch><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
-<outcome value='failure'><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while allocating V4 subnet in EIPAM." />
- </return></outcome></execute><get-resource
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-network-role-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$tmp.level1-key-value`"/>
+ <parameter name="field6" value="`$tmp.eipam-pool-row.pool-id`"/>
+ <parameter name="field7" value="Level 1 subnet saved to DB."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='2'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.activate-subnet-flag" value="N"/>
+ <parameter name="eipam-ip-block.leaf-level-indicator" value="Y"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.pools_length" value="2"/>
+ <!-- Level 1 -->
+ <parameter name="eipam-ip-block.pools[0].key-name" value="`$tmp.level1-key-name`"/>
+ <parameter name="eipam-ip-block.pools[0].key-value" value="`$tmp.level1-key-value`"/>
+ <!-- Level 2 -->
+ <parameter name="eipam-ip-block.pools[1].key-name" value="`$tmp.level2-key-name`"/>
+ <parameter name="eipam-ip-block.pools[1].key-value" value="`$tmp.level2-key-value`"/>
+ </set>
+ <switch test="`$eipam-ip-block.subnet-size-override`">
+ <outcome value=''>
+ <block atomic='true'>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-network-role-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="field5" value="`$tmp.level2-key-value`"/>
+ <parameter name="field6" value="Level 2 subnet override not set, default to network model value."/>
+ </record>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.subnet-size-override" value="`$network-model.ipv6-cidr-mask`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="allocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while allocating V4 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="SELECT * from EIPAM_IP_POOLS WHERE plan_name = $network-model.eipam-v6-address-plan and level = 2 and parent_pool = $tmp.level1-key-value AND key_value = $tmp.level2-key-value ; "
pfx='pfx.eipam-pool-row'>
-
-<outcome value='failure'><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
- </return></outcome><outcome value="not-found"><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
- </return></outcome></get-resource><save
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while looking for entry in EIPAM_IP_POOLS for V6 subnet in EIPAM." />
+ </return>
+ </outcome>
+ </get-resource>
+ <save
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="INSERT EIPAM_IP_SUBNETS
@@ -318,11 +451,15 @@
network_id = $tmp.network-id ; "
force='true'
pfx='pfx.eipam-v6subnet-row'>
-<outcome value='failure'><return status='failure'>
-<parameter name='error-code' value='500' />
-<parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
-</return></outcome><outcome value='success'>
-</outcome></save><save
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="INSERT EIPAM_IP_SUBNET_KEYS
@@ -333,11 +470,15 @@
level = 1 ; "
force='true'
pfx='pfx.eipam-v6subnet-key-row'>
-<outcome value='failure'><return status='failure'>
-<parameter name='error-code' value='500' />
-<parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
-</return></outcome><outcome value='success'>
-</outcome></save><save
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="INSERT EIPAM_IP_SUBNET_KEYS
@@ -348,29 +489,49 @@
level = 2 ; "
force='true'
pfx='pfx.eipam-v6subnet-key-row'>
-<outcome value='failure'><return status='failure'>
-<parameter name='error-code' value='500' />
-<parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
-</return></outcome><outcome value='success'>
-</outcome></save><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="network-topology-operation"/>
-<parameter name="field3" value="eipam-allocate-network-role-subnet"/>
-<parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
-<parameter name="field5" value="`$tmp.level1-key-value`"/>
-
-<!-- Level 2 -->
- <parameter name="field6" value="NETWORK_ROLE_NETWORK_ID"/>
- <parameter name="field7" value="`$tmp.level2-key-value`"/>
-<parameter name="field8" value="Level 2 subnet saved to DB."/></record></block></outcome><outcome value=''><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
- </return></outcome></switch></block></outcome><outcome value=''><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Please set the eipam-ip-block.allocate-version for appropriate EIPAM request." />
- </return></outcome></switch><return status='success'>
- <parameter name="error-code" value="200" />
-</return></block></method></service-logic>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS table.' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-allocate-network-role-subnet"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$tmp.level1-key-value`"/>
+ <!-- Level 2 -->
+ <parameter name="field6" value="NETWORK_ROLE_NETWORK_ID"/>
+ <parameter name="field7" value="`$tmp.level2-key-value`"/>
+ <parameter name="field8" value="Level 2 subnet saved to DB."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.allocate-version for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="error-code" value="200" />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_eipam-create-generic-pool.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_eipam-create-generic-pool.xml
new file mode 100755
index 00000000..1940615d
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_eipam-create-generic-pool.xml
@@ -0,0 +1,901 @@
+<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='eipam-create-generic-pool' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.eipam-error" value="false" />
+ <parameter name="tmp.create-v4-pool-flag" value="N" />
+ <parameter name="tmp.create-v6-pool-flag" value="N" />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ <parameter name="eipam-pool.v4.pre-existing" value="N"/>
+ <parameter name="eipam-pool.v6.pre-existing" value="N"/>
+ <parameter name="level" value="`$eipam-ip-block.level - 1`" />
+ </set>
+ <switch test="`$tmp.allocate-subnet-flag`">
+ <outcome value="">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.allocate-subnet-flag" value="Y"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Y'></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * FROM EIPAM_IP_POOLS where plan_name = $network-model.eipam-v4-address-plan and level = $eipam-ip-block.level and key_value = $v4FQPN-output.pools[$level].key-value ;"
+ pfx='tmp.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_POOLS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-generic-pool"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$v4FQPN-output.pools[$eipam-ip-block.level - 1].key-value`"/>
+ <parameter name="field6" value="Level already exists, SKIP."/>
+ <parameter name="field7" value="`$eipam-ip-block.level`"/>
+ <parameter name="field8" value="`$tmp.eipam-pool-row.pool-id`"/>
+ </record>
+ <set>
+ <parameter name="eipam-pool.v4.pre-existing" value="Y"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <switch test="`$l-idx`">
+ <outcome value='1'>
+ <block atomic='true'>
+ <switch test="`$tmp.qip-pool`">
+ <outcome value=""></outcome>
+ <outcome value='Other'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value="`$tmp.qip-pool`"/>
+ <parameter name="tmp.v4-qip-pool" value="`$tmp.qip-pool`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.skip-first-level`">
+ <outcome value='Y'></outcome>
+ <outcome value="">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="network-topology-identifier-structure.eipam-v4-address-plan" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="`$tmp.allocate-subnet-flag`"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.create-v4-pool-flag" value="Y" />
+ </set>
+ <for index="l4-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-name" value="`$v4FQPN-output.pools[$l4-idx].key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-value" value="`$v4FQPN-output.pools[$l4-idx].key-value`"/>
+ </set>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-generic-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-value`"/>
+ </record>
+ </block>
+ </for>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='N'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="network-topology-identifier-structure.eipam-v4-address-plan" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="`$tmp.allocate-subnet-flag`"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.create-v4-pool-flag" value="Y" />
+ </set>
+ <for index="l4-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-name" value="`$v4FQPN-output.pools[$l4-idx].key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-value" value="`$v4FQPN-output.pools[$l4-idx].key-value`"/>
+ </set>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-generic-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-value`"/>
+ </record>
+ </block>
+ </for>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="network-topology-identifier-structure.eipam-v4-address-plan" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="`$tmp.allocate-subnet-flag`"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.create-v4-pool-flag" value="Y" />
+ </set>
+ <for index="l4-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-name" value="`$v4FQPN-output.pools[$l4-idx].key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-value" value="`$v4FQPN-output.pools[$l4-idx].key-value`"/>
+ </set>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-generic-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l4-idx].key-value`"/>
+ </record>
+ </block>
+ </for>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * FROM EIPAM_IP_POOLS where plan_name = $network-model.eipam-v6-address-plan and level = $eipam-ip-block.level and key_value = $v6FQPN-output.pools[$level].key-value ;"
+ pfx='tmp.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_POOLS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-generic-pool"/>
+ <parameter name="field4" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="field5" value="`$v6FQPN-output.pools[$eipam-ip-block.level - 1].key-value`"/>
+ <parameter name="field6" value="Level already exists, SKIP."/>
+ <parameter name="field7" value="`$eipam-ip-block.level`"/>
+ <parameter name="field8" value="`$tmp.eipam-pool-row.pool-id`"/>
+ </record>
+ <set>
+ <parameter name="eipam-pool.v6.pre-existing" value="Y"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <switch test="`$l-idx`">
+ <outcome value='1'>
+ <block atomic='true'>
+ <switch test="`$tmp.qip-pool`">
+ <outcome value=""></outcome>
+ <outcome value='Other'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value="`$tmp.qip-pool`"/>
+ <parameter name="tmp.v6-qip-pool" value="`$tmp.qip-pool`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.skip-first-level`">
+ <outcome value='Y'></outcome>
+ <outcome value="">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="network-topology-identifier-structure.eipam-v6-address-plan" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="`$tmp.allocate-subnet-flag`"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.create-v6-pool-flag" value="Y" />
+ </set>
+ <for index="l6-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-name" value="`$v6FQPN-output.pools[$l6-idx].key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-value" value="`$v6FQPN-output.pools[$l6-idx].key-value`"/>
+ </set>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-generic-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-value`"/>
+ <parameter name="field7" value="`$l6-idx`"/>
+ </record>
+ </block>
+ </for>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='N'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="network-topology-identifier-structure.eipam-v6-address-plan" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="`$tmp.allocate-subnet-flag`"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.create-v6-pool-flag" value="Y" />
+ </set>
+ <for index="l6-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-name" value="`$v6FQPN-output.pools[$l6-idx].key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-value" value="`$v6FQPN-output.pools[$l6-idx].key-value`"/>
+ </set>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-generic-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-value`"/>
+ <parameter name="field7" value="`$l6-idx`"/>
+ </record>
+ </block>
+ </for>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="network-topology-identifier-structure.eipam-v6-address-plan" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="`$tmp.allocate-subnet-flag`"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.create-v6-pool-flag" value="Y" />
+ </set>
+ <for index="l6-idx" start="0" end="`$eipam-ip-block.level`">
+ <block atomic='true'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-name" value="`$v6FQPN-output.pools[$l6-idx].key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-value" value="`$v6FQPN-output.pools[$l6-idx].key-value`"/>
+ </set>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-generic-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[$l6-idx].key-value`"/>
+ <parameter name="field7" value="`$l6-idx`"/>
+ </record>
+ </block>
+ </for>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <switch test="`$tmp.create-v4-pool-flag`">
+ <outcome value='Y'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="createPool">
+ <outcome value='success'></outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while creating pool in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ </outcome>
+ <outcome value='N'>
+ <switch test="`$tmp.create-v6-pool-flag`">
+ <outcome value='Y'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="createPool">
+ <outcome value='success'></outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while creating pool in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test="`$eipam-pool.v4.pre-existing`">
+ <outcome value='N'>
+ <block atomic='true'>
+ <set>
+ <parameter name="key-name" value="`$v4FQPN-output.pools[$eipam-ip-block.level - 1].key-name`" />
+ <parameter name="key-value" value="`$v4FQPN-output.pools[$eipam-ip-block.level - 1].key-value`" />
+ </set>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name="parent_pool" value="`$tmp.v4-qip-pool`" />
+ <parameter name="level" value="`$eipam-ip-block.level - 1`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="parent_pool" value="`$v4FQPN-output.pools[$eipam-ip-block.level - 2].key-value`" />
+ <parameter name="level" value="`$eipam-ip-block.level - 1`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-generic-pool"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$key-name`"/>
+ <parameter name="field6" value="`$key-value`"/>
+ <parameter name="field7" value="`$tmp.network_instance_group_id`"/>
+ <parameter name="field8" value="`$eipam-ip-block.level`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="Saving to EIPAM_IP_POOLS table."/>
+ </record>
+ <switch test="`$network-instance-group-data.subnet-assignment-policy.subnet-use`">
+ <outcome value='shared'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_POOLS
+ SET
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ address_family = $network-model.ipv4-ip-version ,
+ parent_pool = $parent_pool ,
+ service_instance_id = $network-topology-operation-input.service-information.service-instance-id ,
+ network_id = $tmp.network-id ,
+ network_instance_group_id = $tmp.network-instance-group-id ; "
+ force='true'
+ pfx='pfx.eipam-v4pool-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_POOLS
+ SET
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ address_family = $network-model.ipv4-ip-version ,
+ parent_pool = $parent_pool ,
+ service_instance_id = $network-topology-operation-input.service-information.service-instance-id ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4pool-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value=''>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_POOLS
+ SET
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ address_family = $network-model.ipv4-ip-version ,
+ parent_pool = $parent_pool ,
+ service_instance_id = $network-topology-operation-input.service-information.service-instance-id ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v4pool-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <switch test="`$eipam-ip-block.level == $eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <switch test="`$tmp.allocate-subnet-flag`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <for index="i" start="0" end="`$eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan_length`">
+ <block atomic='true'>
+ <switch test="`$network-model.eipam-v4-address-plan == $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PlanName`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="index_found" value="true" />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$index_found`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * FROM EIPAM_IP_POOLS where plan_name = $network-model.eipam-v4-address-plan and level = $eipam-ip-block.level and key_value = $v4FQPN-output.pools[$level].key-value ;"
+ pfx='tmp.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_POOLS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PoolItem.IPDataBlock.IpamPoolAllocId ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PoolItem.IPDataBlock.IPAddress ,
+ prefix_length = $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PoolItem.IPDataBlock.Mask ,
+ plan_name = $network-model.eipam-v4-address-plan ,
+ status = 'ALLOCATED' ,
+ pool_id = $tmp.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv4-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS .' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PoolItem.IPDataBlock.IpamPoolAllocId ,
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-key-row'>
+ <outcome value='success'></outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS .' />
+ </return>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_POOLS failed." />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to find plan name in CreatePoolResponse.' />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to find plan name in CreatePoolResponse.' />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Y'></outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test="`$eipam-pool.v6.pre-existing`">
+ <outcome value='N'>
+ <block atomic='true'>
+ <set>
+ <parameter name="key-name" value="`$v6FQPN-output.pools[$eipam-ip-block.level - 1].key-name`" />
+ <parameter name="key-value" value="`$v6FQPN-output.pools[$eipam-ip-block.level - 1].key-value`" />
+ </set>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value='1'>
+ <set>
+ <parameter name="parent_pool" value="`$tmp.v6-qip-pool`" />
+ <parameter name="level" value="`$eipam-ip-block.level - 1`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name="parent_pool" value="`$v6FQPN-output.pools[$eipam-ip-block.level - 2].key-value`" />
+ <parameter name="level" value="`$eipam-ip-block.level - 1`" />
+ </set>
+ </outcome>
+ </switch>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-network-role-pool"/>
+ <parameter name="field4" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="field5" value="`$v6FQPN-output.pools[$level].key-name`"/>
+ <parameter name="field6" value="`$v6FQPN-output.pools[$level].key-value`"/>
+ <parameter name="field7" value="`$tmp.network_instance_group_id`"/>
+ <parameter name="field8" value="`$eipam-ip-block.level`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="Saving to EIPAM_IP_POOLS table."/>
+ </record>
+ <switch test="`$network-instance-group-data.subnet-assignment-policy.subnet-use`">
+ <outcome value='shared'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_POOLS
+ SET
+ key_name = $v6FQPN-output.pools[$level].key-name ,
+ key_value = $v6FQPN-output.pools[$level].key-value ,
+ level = $eipam-ip-block.level ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ address_family = $network-model.ipv6-ip-version ,
+ parent_pool = $parent_pool ,
+ service_instance_id = $network-topology-operation-input.service-information.service-instance-id ,
+ network_id = $tmp.network-id ,
+ network_instance_group_id = $tmp.network-instance-group-id ; "
+ force='true'
+ pfx='pfx.eipam-v6pool-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_POOLS
+ SET
+ key_name = $v6FQPN-output.pools[$level].key-name ,
+ key_value = $v6FQPN-output.pools[$level].key-value ,
+ level = $eipam-ip-block.level ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ address_family = $network-model.ipv6-ip-version ,
+ parent_pool = $parent_pool ,
+ service_instance_id = $network-topology-operation-input.service-information.service-instance-id ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6pool-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value=''>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_POOLS
+ SET
+ key_name = $v6FQPN-output.pools[$level].key-name ,
+ key_value = $v6FQPN-output.pools[$level].key-value ,
+ level = $eipam-ip-block.level ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ address_family = $network-model.ipv6-ip-version ,
+ parent_pool = $parent_pool ,
+ service_instance_id = $network-topology-operation-input.service-information.service-instance-id ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-v6pool-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <switch test="`$eipam-ip-block.level == $eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <switch test="`$tmp.allocate-subnet-flag`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <for index="i" start="0" end="`$eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan_length`">
+ <block atomic='true'>
+ <switch test="`$network-model.eipam-v6-address-plan == $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PlanName`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="index_found" value="true" />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$index_found`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * FROM EIPAM_IP_POOLS where plan_name = $network-model.eipam-v6-address-plan and level = $eipam-ip-block.level and key_value = $v6FQPN-output.pools[$level].key-value ;"
+ pfx='tmp.eipam-pool-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_POOLS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PoolItem.IPDataBlock.IpamPoolAllocId ,
+ service_type = $tmp.service-type ,
+ ip_address = $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PoolItem.IPDataBlock.IPAddress ,
+ prefix_length = $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PoolItem.IPDataBlock.Mask ,
+ plan_name = $network-model.eipam-v6-address-plan ,
+ status = 'ALLOCATED' ,
+ pool_id = $tmp.eipam-pool-row.pool-id ,
+ address_family = $network-model.ipv6-ip-version ,
+ network_id = $tmp.network-id ; "
+ force='true'
+ pfx='pfx.eipam-subnet-row'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNETS .' />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.createPoolResponse.CreatePoolPlans.CreatePoolPlan[$i].PoolItem.IPDataBlock.IpamPoolAllocId ,
+ key_name = $key-name ,
+ key_value = $key-value ,
+ level = $eipam-ip-block.level ; "
+ force='true'
+ pfx='pfx.eipam-v4subnet-key-row'>
+ <outcome value='success'></outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_SUBNET_KEYS .' />
+ </return>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_POOLS failed." />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to find plan name in CreatePoolResponse.' />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to find plan name in CreatePoolResponse.' />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Y'></outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="error-code" value="200" />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_eipam-create-network-role-pool.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_eipam-create-network-role-pool.xml
index ae2bb75d..49436b46 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_eipam-create-network-role-pool.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_eipam-create-network-role-pool.xml
@@ -1,300 +1,539 @@
-<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='eipam-create-network-role-pool' mode='sync'>
-<block atomic='true'><set>
- <parameter name="tmp.eipam-error" value="false" />
- <parameter name="tmp.create-v4-pool-flag" value="N" />
- <parameter name="tmp.create-v6-pool-flag" value="N" />
- <parameter name='eipam-ip-block.plans_length' value='0' />
- <parameter name="eipam-pool.v4.pre-existing" value="false"/>
- <parameter name="eipam-pool.v6.pre-existing" value="false"/>
- <parameter name="tmp.v4-level1-key-name" value="CLLI:CLOUD_REGION" />
- <parameter name="tmp.v4-level2-key-name" value="NETWORK_ROLE:NETWORK_ID" />
- <parameter name="tmp.v6-level1-key-name" value="CLLI:CLOUD_REGION" />
- <parameter name="tmp.v6-level2-key-name" value="NETWORK_ROLE:NETWORK_ID" /></set><switch test="`$tmp.region`"><outcome value="USA"><set>
- <parameter name="tmp.region" value="US" />
-</set></outcome></switch><switch test="`$network-model.use-ipv4`"><outcome value='Y'><block atomic='true'><switch test="`$eipam-ip-block.level`"><outcome value='1'><get-resource
+<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='eipam-create-network-role-pool' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.eipam-error" value="false" />
+ <parameter name="tmp.create-v4-pool-flag" value="N" />
+ <parameter name="tmp.create-v6-pool-flag" value="N" />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ <parameter name="eipam-pool.v4.pre-existing" value="false"/>
+ <parameter name="eipam-pool.v6.pre-existing" value="false"/>
+ <parameter name="tmp.v4-level1-key-name" value="LOCATION_CLLI8:CLOUD_REGION_ID" />
+ <parameter name="tmp.v4-level2-key-name" value="NETWORK_ROLE:NETWORK_ID" />
+ <parameter name="tmp.v6-level1-key-name" value="LOCATION_CLLI8:CLOUD_REGION_ID" />
+ <parameter name="tmp.v6-level2-key-name" value="NETWORK_ROLE:NETWORK_ID" />
+ </set>
+ <switch test="`$tmp.region`">
+ <outcome value="USA">
+ <set>
+ <parameter name="tmp.region" value="US" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value='1'>
+ <get-resource
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="SELECT * FROM EIPAM_IP_POOLS where plan_name = $network-model.eipam-v4-address-plan and level = 1 and key_value = $tmp.level1-key-value ;"
pfx='tmp.eipam-pool-row'>
-
-<outcome value='failure'>
-<return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Query to DB table EIPAM_IP_POOLS failed." />
- </return></outcome><outcome value='success'>
-<block atomic='true'><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="network-topology-operation"/>
-<parameter name="field3" value="eipam-create-network-role-pool"/>
-<parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
-<parameter name="field5" value="`$tmp.level1-key-value`"/>
-<parameter name="field6" value="Level 1 already exists, SKIP."/>
-<parameter name="field7" value="`$tmp.eipam-pool-row.pool-id`"/>
-</record><set>
- <parameter name="eipam-pool.v4.pre-existing" value="true"/>
-</set></block></outcome><outcome value="not-found"><block atomic='true'><switch test="`$network-model.eipam-v4-address-plan`"><outcome value="AIC_ATM_UNPROTECTED_V4"><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><set>
- <parameter name="tmp.qip-pool" value="`'ATM-U ' + $tmp.region`"/>
-</set></outcome><outcome value="AIC_DATA_PLANE_UNPROTECTED_V4"><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><set>
- <parameter name="tmp.qip-pool" value="`'DP-U ' + $tmp.region`"/>
-</set></outcome><outcome value="AIC_DATA_PLANE_PRIVATE_V4"><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><set>
- <parameter name="tmp.qip-pool" value="`'DP-Private ' + $tmp.region`"/>
-</set></outcome><outcome value="AIC_ATM_PROTECTED_V4"><set>
- <parameter name="tmp.qip-pool" value="`'ATM-P ' + $tmp.region`"/>
-</set></outcome><outcome value="AIC_DATA_PLANE_PROTECTED_V4"><set>
- <parameter name="tmp.qip-pool" value="`'DP-P ' + $tmp.region`"/>
-</set></outcome><outcome value="AIC_AIM_LANDING_NETWORK_V4"><set>
- <parameter name="tmp.qip-pool" value="`'AIC-AIM-LANDING-V4 ' + $tmp.region`"/>
- <parameter name="tmp.v4-level1-key-name" value="CLLI:CLOUD_REGION" />
- <parameter name="tmp.v4-level2-key-name" value="NETWORK_ROLE:NETWORK_ID" />
-</set></outcome><outcome value='Other'><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="EIPAM Address Plan is not valid." />
- </return></outcome></switch><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><set>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v4-address-plan`"/>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="N"/>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value="`$tmp.qip-pool`"/>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
- <!-- Number of Pool Levels -->
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="1"/>
-
- <!-- Level 1 -->
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name" value="`$tmp.v4-level1-key-name`"/>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value" value="`$tmp.level1-key-value`"/>
- <parameter name="tmp.create-v4-pool-flag" value="Y" />
- <parameter name="tmp.v4-qip-pool" value="`$tmp.qip-pool`" /></set><switch test="`$eipam-ip-block.level`"><outcome value=''><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
- </return></outcome><outcome value='2'><set>
- <!-- Number of Pool Levels -->
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
-
- <!-- Level 2 -->
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value=""/>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name" value="`$tmp.v4-level2-key-name`"/>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value" value="`$tmp.level2-key-value`"/></set></outcome><outcome value='Other'></outcome></switch><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="network-topology-operation"/>
-<parameter name="field3" value="eipam-create-network-role-pool"/>
-<parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
-<parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name`"/>
-<parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value`"/>
-<parameter name="field7" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name`"/>
-<parameter name="field8" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value`"/>
-</record><set>
- <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" /></set></block></outcome></get-resource></outcome><outcome value=''><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
- </return></outcome><outcome value='2'><block atomic='true'><switch test="`$network-model.eipam-v4-address-plan`"><outcome value="AIC_ATM_UNPROTECTED_V4"><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><set>
- <parameter name="tmp.qip-pool" value="`'ATM-U ' + $tmp.region`"/>
-</set></outcome><outcome value="AIC_DATA_PLANE_UNPROTECTED_V4"><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><set>
- <parameter name="tmp.qip-pool" value="`'DP-U ' + $tmp.region`"/>
-</set></outcome><outcome value="AIC_DATA_PLANE_PRIVATE_V4"><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><set>
- <parameter name="tmp.qip-pool" value="`'DP-Private ' + $tmp.region`"/>
-</set></outcome><outcome value="AIC_ATM_PROTECTED_V4"><set>
- <parameter name="tmp.qip-pool" value="`'ATM-P ' + $tmp.region`"/>
-</set></outcome><outcome value="AIC_DATA_PLANE_PROTECTED_V4"><set>
- <parameter name="tmp.qip-pool" value="`'DP-P ' + $tmp.region`"/>
-</set></outcome><outcome value="AIC_AIM_LANDING_NETWORK_V4"><set>
- <parameter name="tmp.qip-pool" value="`'AIC-AIM-LANDING-V4 ' + $tmp.region`"/>
- <parameter name="tmp.v4-level1-key-name" value="CLLI:CLOUD_REGION" />
- <parameter name="tmp.v4-level2-key-name" value="NETWORK_ROLE:NETWORK_ID" />
-</set></outcome><outcome value='Other'><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="EIPAM Address Plan is not valid." />
- </return></outcome></switch><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><set>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v4-address-plan`"/>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="N"/>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value="`$tmp.qip-pool`"/>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
- <!-- Number of Pool Levels -->
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="1"/>
-
- <!-- Level 1 -->
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name" value="`$tmp.v4-level1-key-name`"/>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value" value="`$tmp.level1-key-value`"/>
- <parameter name="tmp.create-v4-pool-flag" value="Y" />
- <parameter name="tmp.v4-qip-pool" value="`$tmp.qip-pool`" /></set><switch test="`$eipam-ip-block.level`"><outcome value=''><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
- </return></outcome><outcome value='2'><set>
- <!-- Number of Pool Levels -->
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
-
- <!-- Level 2 -->
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value=""/>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name" value="`$tmp.v4-level2-key-name`"/>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value" value="`$tmp.level2-key-value`"/></set></outcome><outcome value='Other'></outcome></switch><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="network-topology-operation"/>
-<parameter name="field3" value="eipam-create-network-role-pool"/>
-<parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
-<parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name`"/>
-<parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value`"/>
-<parameter name="field7" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name`"/>
-<parameter name="field8" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value`"/>
-</record><set>
- <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" /></set></block></outcome></switch></block></outcome><outcome value=""></outcome><outcome value='N'></outcome></switch><switch test="`$network-model.use-ipv6`"><outcome value='Y'><block atomic='true'><switch test="`$eipam-ip-block.level`"><outcome value='1'><get-resource
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_POOLS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-network-role-pool"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$tmp.level1-key-value`"/>
+ <parameter name="field6" value="Level 1 already exists, SKIP."/>
+ <parameter name="field7" value="`$tmp.eipam-pool-row.pool-id`"/>
+ </record>
+ <set>
+ <parameter name="eipam-pool.v4.pre-existing" value="true"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'>
+ <switch test="`$network-model.eipam-v4-address-plan`">
+ <outcome value="AIC_ATM_UNPROTECTED_V4">
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.qip-pool" value="`'ATM-U ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_UNPROTECTED_V4">
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.qip-pool" value="`'DP-U ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PRIVATE_V4">
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.qip-pool" value="`'DP-Private ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_ATM_PROTECTED_V4">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'ATM-P ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PROTECTED_V4">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'DP-P ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_AIM_LANDING_NETWORK_V4">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-AIM-LANDING-V4 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="EIPAM Address Plan is not valid." />
+ </return>
+ </outcome>
+ </switch>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="N"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value="`$tmp.qip-pool`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="1"/>
+ <!-- Level 1 -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name" value="`$tmp.v4-level1-key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value" value="`$tmp.level1-key-value`"/>
+ <parameter name="tmp.create-v4-pool-flag" value="Y" />
+ <parameter name="tmp.v4-qip-pool" value="`$tmp.qip-pool`" />
+ </set>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='2'>
+ <set>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ <!-- Level 2 -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value=""/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name" value="`$tmp.v4-level2-key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value" value="`$tmp.level2-key-value`"/>
+ </set>
+ </outcome>
+ <outcome value='Other'></outcome>
+ </switch>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-network-role-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value`"/>
+ <parameter name="field7" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name`"/>
+ <parameter name="field8" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value`"/>
+ </record>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ </get-resource>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='2'>
+ <block atomic='true'>
+ <switch test="`$network-model.eipam-v4-address-plan`">
+ <outcome value="AIC_ATM_UNPROTECTED_V4">
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.qip-pool" value="`'ATM-U ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_UNPROTECTED_V4">
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.qip-pool" value="`'DP-U ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PRIVATE_V4">
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="tmp.qip-pool" value="`'DP-Private ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_ATM_PROTECTED_V4">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'ATM-P ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PROTECTED_V4">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'DP-P ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_AIM_LANDING_NETWORK_V4">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-AIM-LANDING-V4 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="EIPAM Address Plan is not valid." />
+ </return>
+ </outcome>
+ </switch>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="N"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value="`$tmp.qip-pool`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="1"/>
+ <!-- Level 1 -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name" value="`$tmp.v4-level1-key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value" value="`$tmp.level1-key-value`"/>
+ <parameter name="tmp.create-v4-pool-flag" value="Y" />
+ <parameter name="tmp.v4-qip-pool" value="`$tmp.qip-pool`" />
+ </set>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='2'>
+ <set>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ <!-- Level 2 -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value=""/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name" value="`$tmp.v4-level2-key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value" value="`$tmp.level2-key-value`"/>
+ </set>
+ </outcome>
+ <outcome value='Other'></outcome>
+ </switch>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-network-role-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value`"/>
+ <parameter name="field7" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name`"/>
+ <parameter name="field8" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value`"/>
+ </record>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value='1'>
+ <get-resource
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="SELECT * FROM EIPAM_IP_POOLS where plan_name = $network-model.eipam-v6-address-plan and level = 1 and key_value = $tmp.level1-key-value ;"
pfx='tmp.eipam-pool-row'>
-
-<outcome value='failure'>
-<return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Query to DB table EIPAM_IP_POOLS failed." />
- </return></outcome><outcome value='success'>
-<block atomic='true'><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="network-topology-operation"/>
-<parameter name="field3" value="eipam-create-network-role-pool"/>
-<parameter name="field4" value="`$network-model.eipam-v6-address-plan`"/>
-<parameter name="field5" value="`$tmp.level1-key-value`"/>
-<parameter name="field6" value="Level 1 already exists, SKIP."/>
-<parameter name="field7" value="`$tmp.eipam-pool-row.pool-id`"/></record><set>
- <parameter name="eipam-pool.v6.pre-existing" value="true"/>
-</set></block></outcome><outcome value="not-found"><block atomic='true'><switch test="`$network-model.eipam-v6-address-plan`"><outcome value="AIC_ATM_UNPROTECTED_V6"><set>
- <parameter name="tmp.qip-pool" value="`'ATM-U-V6 ' + $tmp.region`"/>
-</set></outcome><outcome value="AIC_AIM_LANDING_NETWORK_V6"><set>
- <parameter name="tmp.qip-pool" value="`'AIC-AIM-LANDING-V6 ' + $tmp.region`"/>
-
-</set></outcome><outcome value="AIC_ATM_PROTECTED_V6"><set>
- <parameter name="tmp.qip-pool" value="`'ATM-P-V6 ' + $tmp.region`"/>
-</set></outcome><outcome value="AIC_DATA_PLANE_UNPROTECTED_V6"><set>
- <parameter name="tmp.qip-pool" value="`'AIC-DP-U-V6 ' + $tmp.region`"/>
- <parameter name="tmp.v6-level1-key-name" value="CLLI:CLOUD_REGION" />
- <parameter name="tmp.v6-level2-key-name" value="NETWORK_ROLE:NETWORK_ID" />
-</set></outcome><outcome value="AIC_DATA_PLANE_PRIVATE_V6"><set>
- <parameter name="tmp.qip-pool" value="`'AIC-DP-PRIVATE-V6 ' + $tmp.region`"/>
- <parameter name="tmp.v6-level1-key-name" value="CLLI:CLOUD_REGION" />
- <parameter name="tmp.v6-level2-key-name" value="NETWORK_ROLE:NETWORK_ID" />
-</set></outcome><outcome value="AIC_DATA_PLANE_PROTECTED_V6"><set>
- <parameter name="tmp.qip-pool" value="`'AIC-DP-P-V6 ' + $tmp.region`"/>
- <parameter name="tmp.v6-level1-key-name" value="CLLI:CLOUD_REGION" />
- <parameter name="tmp.v6-level2-key-name" value="NETWORK_ROLE:NETWORK_ID" />
-</set></outcome><outcome value='Other'><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="EIPAM Address Plan is not valid." />
- </return></outcome></switch><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><set>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v6-address-plan`"/>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="N"/>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value="`$tmp.qip-pool`"/>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
- <!-- Number of Pool Levels -->
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="1"/>
-
- <!-- Level 1 -->
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name" value="`$tmp.v6-level1-key-name`"/>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value" value="`$tmp.level1-key-value`"/>
- <parameter name="tmp.create-v6-pool-flag" value="Y" />
- <parameter name="tmp.v6-qip-pool" value="`$tmp.qip-pool`" /></set><switch test="`$eipam-ip-block.level`"><outcome value=''><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
- </return></outcome><outcome value='2'><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><set>
- <!-- Number of Pool Levels -->
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
-
- <!-- Level 2 -->
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value=""/>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name" value="`$tmp.v6-level2-key-name`"/>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value" value="`$tmp.level2-key-value`"/></set></outcome><outcome value='Other'></outcome></switch><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="network-topology-operation"/>
-<parameter name="field3" value="eipam-create-network-role-pool"/>
-<parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
-<parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name`"/>
-<parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value`"/>
-<parameter name="field7" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name`"/>
-<parameter name="field8" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value`"/>
-</record><set>
- <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" /></set></block></outcome></get-resource></outcome><outcome value=''><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
- </return></outcome><outcome value='2'><block atomic='true'><switch test="`$network-model.eipam-v6-address-plan`"><outcome value="AIC_ATM_UNPROTECTED_V6"><set>
- <parameter name="tmp.qip-pool" value="`'ATM-U-V6 ' + $tmp.region`"/>
-</set></outcome><outcome value="AIC_AIM_LANDING_NETWORK_V6"><set>
- <parameter name="tmp.qip-pool" value="`'AIC-AIM-LANDING-V6 ' + $tmp.region`"/>
-
-</set></outcome><outcome value="AIC_ATM_PROTECTED_V6"><set>
- <parameter name="tmp.qip-pool" value="`'ATM-P-V6 ' + $tmp.region`"/>
-</set></outcome><outcome value="AIC_DATA_PLANE_UNPROTECTED_V6"><set>
- <parameter name="tmp.qip-pool" value="`'AIC-DP-U-V6 ' + $tmp.region`"/>
- <parameter name="tmp.v6-level1-key-name" value="CLLI:CLOUD_REGION" />
- <parameter name="tmp.v6-level2-key-name" value="NETWORK_ROLE:NETWORK_ID" />
-</set></outcome><outcome value="AIC_DATA_PLANE_PRIVATE_V6"><set>
- <parameter name="tmp.qip-pool" value="`'AIC-DP-PRIVATE-V6 ' + $tmp.region`"/>
- <parameter name="tmp.v6-level1-key-name" value="CLLI:CLOUD_REGION" />
- <parameter name="tmp.v6-level2-key-name" value="NETWORK_ROLE:NETWORK_ID" />
-</set></outcome><outcome value="AIC_DATA_PLANE_PROTECTED_V6"><set>
- <parameter name="tmp.qip-pool" value="`'AIC-DP-P-V6 ' + $tmp.region`"/>
- <parameter name="tmp.v6-level1-key-name" value="CLLI:CLOUD_REGION" />
- <parameter name="tmp.v6-level2-key-name" value="NETWORK_ROLE:NETWORK_ID" />
-</set></outcome><outcome value='Other'><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="EIPAM Address Plan is not valid." />
- </return></outcome></switch><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><set>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v6-address-plan`"/>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="N"/>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value="`$tmp.qip-pool`"/>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
- <!-- Number of Pool Levels -->
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="1"/>
-
- <!-- Level 1 -->
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name" value="`$tmp.v6-level1-key-name`"/>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value" value="`$tmp.level1-key-value`"/>
- <parameter name="tmp.create-v6-pool-flag" value="Y" />
- <parameter name="tmp.v6-qip-pool" value="`$tmp.qip-pool`" /></set><switch test="`$eipam-ip-block.level`"><outcome value=''><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
- </return></outcome><outcome value='2'><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><set>
- <!-- Number of Pool Levels -->
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
-
- <!-- Level 2 -->
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value=""/>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name" value="`$tmp.v6-level2-key-name`"/>
- <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value" value="`$tmp.level2-key-value`"/></set></outcome><outcome value='Other'></outcome></switch><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="network-topology-operation"/>
-<parameter name="field3" value="eipam-create-network-role-pool"/>
-<parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
-<parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name`"/>
-<parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value`"/>
-<parameter name="field7" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name`"/>
-<parameter name="field8" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value`"/>
-</record><set>
- <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" /></set></block></outcome></switch></block></outcome><outcome value=""></outcome><outcome value='N'></outcome></switch><switch test="`$tmp.create-v4-pool-flag`"><outcome value='Y'><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="createPool">
-<outcome value='success'>
-</outcome><outcome value='failure'><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while creating pool in EIPAM." />
- </return></outcome></execute></outcome><outcome value='N'><switch test="`$tmp.create-v6-pool-flag`"><outcome value='Y'><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="createPool">
-<outcome value='success'>
-</outcome><outcome value='failure'><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while creating pool in EIPAM." />
- </return></outcome></execute></outcome><outcome value='N'></outcome></switch></outcome></switch><switch test="`$network-model.use-ipv4`"><outcome value='Y'><block atomic='true'><switch test="`$tmp.create-v4-pool-flag`"><outcome value='Y'><block atomic='true'><switch test="`$eipam-ip-block.level`"><outcome value='1'><save
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_POOLS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-network-role-pool"/>
+ <parameter name="field4" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="field5" value="`$tmp.level1-key-value`"/>
+ <parameter name="field6" value="Level 1 already exists, SKIP."/>
+ <parameter name="field7" value="`$tmp.eipam-pool-row.pool-id`"/>
+ </record>
+ <set>
+ <parameter name="eipam-pool.v6.pre-existing" value="true"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'>
+ <switch test="`$network-model.eipam-v6-address-plan`">
+ <outcome value="AIC_ATM_UNPROTECTED_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'ATM-U-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_AIM_LANDING_NETWORK_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-AIM-LANDING-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_ATM_PROTECTED_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'ATM-P-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_UNPROTECTED_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-DP-U-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PRIVATE_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-DP-Private-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PROTECTED_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-DP-P-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="EIPAM Address Plan is not valid." />
+ </return>
+ </outcome>
+ </switch>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="N"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value="`$tmp.qip-pool`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="1"/>
+ <!-- Level 1 -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name" value="`$tmp.v6-level1-key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value" value="`$tmp.level1-key-value`"/>
+ <parameter name="tmp.create-v6-pool-flag" value="Y" />
+ <parameter name="tmp.v6-qip-pool" value="`$tmp.qip-pool`" />
+ </set>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='2'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ <!-- Level 2 -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value=""/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name" value="`$tmp.v6-level2-key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value" value="`$tmp.level2-key-value`"/>
+ </set>
+ </outcome>
+ <outcome value='Other'></outcome>
+ </switch>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-network-role-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value`"/>
+ <parameter name="field7" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name`"/>
+ <parameter name="field8" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value`"/>
+ </record>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ </get-resource>
+ </outcome>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='2'>
+ <block atomic='true'>
+ <switch test="`$network-model.eipam-v6-address-plan`">
+ <outcome value="AIC_ATM_UNPROTECTED_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'ATM-U-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_AIM_LANDING_NETWORK_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-AIM-LANDING-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_ATM_PROTECTED_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'ATM-P-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_UNPROTECTED_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-DP-U-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PRIVATE_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-DP-Private-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PROTECTED_V6">
+ <set>
+ <parameter name="tmp.qip-pool" value="`'AIC-DP-P-V6 ' + $tmp.region`"/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="EIPAM Address Plan is not valid." />
+ </return>
+ </outcome>
+ </switch>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].allocate-subnet-flag" value="N"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value="`$tmp.qip-pool`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests_length" value="1"/>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="1"/>
+ <!-- Level 1 -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name" value="`$tmp.v6-level1-key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value" value="`$tmp.level1-key-value`"/>
+ <parameter name="tmp.create-v6-pool-flag" value="Y" />
+ <parameter name="tmp.v6-qip-pool" value="`$tmp.qip-pool`" />
+ </set>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Please set the eipam-ip-block.level for appropriate EIPAM request." />
+ </return>
+ </outcome>
+ <outcome value='2'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <!-- Number of Pool Levels -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools_length" value="`$eipam-ip-block.level`"/>
+ <!-- Level 2 -->
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].parent-pool" value=""/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name" value="`$tmp.v6-level2-key-name`"/>
+ <parameter name="eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value" value="`$tmp.level2-key-value`"/>
+ </set>
+ </outcome>
+ <outcome value='Other'></outcome>
+ </switch>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-network-role-pool"/>
+ <parameter name="field4" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].plan-name`"/>
+ <parameter name="field5" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[0].key-value`"/>
+ <parameter name="field7" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-name`"/>
+ <parameter name="field8" value="`$eipam-ip-block.plans[$eipam-ip-block.plans_length].requests[0].pools[1].key-value`"/>
+ </record>
+ <set>
+ <parameter name="eipam-ip-block.plans_length" value="`$eipam-ip-block.plans_length + 1`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <switch test="`$tmp.create-v4-pool-flag`">
+ <outcome value='Y'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="createPool">
+ <outcome value='success'></outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while creating pool in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ </outcome>
+ <outcome value='N'>
+ <switch test="`$tmp.create-v6-pool-flag`">
+ <outcome value='Y'>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="createPool">
+ <outcome value='success'></outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while creating pool in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ </outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test="`$tmp.create-v4-pool-flag`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value='1'>
+ <save
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="INSERT EIPAM_IP_POOLS
@@ -309,10 +548,18 @@
network_id = $tmp.network-id ; "
force='true'
pfx='pfx.eipam-v4pool-row'>
-<outcome value='failure'><return status='failure'>
-<parameter name='error-code' value='500' />
-<parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
-</return></outcome><outcome value='Other'></outcome><outcome value='Other'></outcome></save></outcome><outcome value='2'><save
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ <outcome value='Other'></outcome>
+ <outcome value='Other'></outcome>
+ </save>
+ </outcome>
+ <outcome value='2'>
+ <save
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="INSERT EIPAM_IP_POOLS
@@ -327,23 +574,49 @@
network_id = $tmp.network-id ; "
force='true'
pfx='pfx.eipam-v4pool-row'>
-<outcome value='failure'><return status='failure'>
-<parameter name='error-code' value='500' />
-<parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
-</return></outcome><outcome value='Other'></outcome><outcome value='Other'></outcome></save></outcome></switch><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="network-topology-operation"/>
-<parameter name="field3" value="eipam-create-network-role-pool"/>
-<parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
-<parameter name="field5" value="`$tmp.v4-level1-key-name`"/>
-<parameter name="field6" value="`$tmp.level1-key-value`"/>
-<parameter name="field7" value="`$tmp.v4-level2-key-name`"/>
-<parameter name="field8" value="`$tmp.level2-key-value`"/>
-<parameter name="field9" value="`$network-model.network-role`"/>
-<parameter name="field10" value="`$tmp.network-id`"/>
-<parameter name="field11" value="Saving to EIPAM_IP_POOLS table."/>
-</record></block></outcome><outcome value='N'></outcome></switch></block></outcome><outcome value=""></outcome><outcome value='N'></outcome></switch><switch test="`$network-model.use-ipv6`"><outcome value='Y'><block atomic='true'><switch test="`$tmp.create-v6-pool-flag`"><outcome value='Y'><block atomic='true'><switch test="`$eipam-ip-block.level`"><outcome value='1'><save
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ <outcome value='Other'></outcome>
+ <outcome value='Other'></outcome>
+ </save>
+ </outcome>
+ </switch>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-network-role-pool"/>
+ <parameter name="field4" value="`$network-model.eipam-v4-address-plan`"/>
+ <parameter name="field5" value="`$tmp.v4-level1-key-name`"/>
+ <parameter name="field6" value="`$tmp.level1-key-value`"/>
+ <parameter name="field7" value="`$tmp.v4-level2-key-name`"/>
+ <parameter name="field8" value="`$tmp.level2-key-value`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="Saving to EIPAM_IP_POOLS table."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test="`$tmp.create-v6-pool-flag`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test="`$eipam-ip-block.level`">
+ <outcome value='1'>
+ <save
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="INSERT EIPAM_IP_POOLS
@@ -358,10 +631,18 @@
network_id = $tmp.network-id ; "
force='true'
pfx='pfx.eipam-v6pool-row'>
-<outcome value='Other'></outcome><outcome value='Other'></outcome><outcome value='failure'><return status='failure'>
-<parameter name='error-code' value='500' />
-<parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
-</return></outcome></save></outcome><outcome value='2'><save
+ <outcome value='Other'></outcome>
+ <outcome value='Other'></outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='2'>
+ <save
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="INSERT EIPAM_IP_POOLS
@@ -376,22 +657,43 @@
network_id = $tmp.network-id ; "
force='true'
pfx='pfx.eipam-v6pool-row'>
-<outcome value='Other'></outcome><outcome value='Other'></outcome><outcome value='failure'><return status='failure'>
-<parameter name='error-code' value='500' />
-<parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
-</return></outcome></save></outcome></switch><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="network-topology-operation"/>
-<parameter name="field3" value="eipam-create-network-role-pool"/>
-<parameter name="field4" value="`$network-model.eipam-v6-address-plan`"/>
-<parameter name="field5" value="`$tmp.v6-level1-key-name`"/>
-<parameter name="field6" value="`$tmp.level1-key-value`"/>
-<parameter name="field7" value="`$tmp.v6-level2-key-name`"/>
-<parameter name="field8" value="`$tmp.level2-key-value`"/>
-<parameter name="field9" value="`$network-model.network-role`"/>
-<parameter name="field10" value="`$tmp.network-id`"/>
-<parameter name="field11" value="Saving to EIPAM_IP_POOLS table."/>
-</record></block></outcome><outcome value='N'></outcome></switch></block></outcome><outcome value=""></outcome><outcome value='N'></outcome></switch><return status='success'>
- <parameter name="error-code" value="200" />
-</return></block></method></service-logic>
+ <outcome value='Other'></outcome>
+ <outcome value='Other'></outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='failed to update EIPAM_IP_POOLS .' />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <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="network-topology-operation"/>
+ <parameter name="field3" value="eipam-create-network-role-pool"/>
+ <parameter name="field4" value="`$network-model.eipam-v6-address-plan`"/>
+ <parameter name="field5" value="`$tmp.v6-level1-key-name`"/>
+ <parameter name="field6" value="`$tmp.level1-key-value`"/>
+ <parameter name="field7" value="`$tmp.v6-level2-key-name`"/>
+ <parameter name="field8" value="`$tmp.level2-key-value`"/>
+ <parameter name="field9" value="`$network-model.network-role`"/>
+ <parameter name="field10" value="`$tmp.network-id`"/>
+ <parameter name="field11" value="Saving to EIPAM_IP_POOLS table."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ <outcome value='N'></outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="error-code" value="200" />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-FQPN.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-FQPN.xml
new file mode 100644
index 00000000..b9699d69
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-FQPN.xml
@@ -0,0 +1,472 @@
+<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='generate-FQPN' mode='sync'>
+ <block atomic="true">
+ <switch test='`$generate-FQPN-input.plan-name`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="generate-FQPN-input.plan-name is null" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='eipam-ip-block.plan-name' value='`$generate-FQPN-input.plan-name`' />
+ </set>
+ <set>
+ <parameter name='generate-FQPN-output.' value='' />
+ </set>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="getPlanTopology">
+ <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 getting Keyname and Keyvalue for address plan, '+ $eipam-ip-block.planName + ', from EIPAM'`" />
+ </return>
+ </outcome>
+ </execute>
+ <switch test='`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="eipam-ip-block.getPlanTopologyResponse.TopologyDetails is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.sdnc-generated-cloud-resources`'>
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-generate-FQPN' mode='sync' ></call>
+ </outcome>
+ <outcome value='false'>
+ <block atomic='true'>
+ <for index="resp-index" start="0" end="`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length`">
+ <switch test='`$eipam-ip-block.plan-name == $eipam-ip-block.getPlanTopologyResponse.PlanName`'>
+ <outcome value='false'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'eipam response plan-name ['+ $eipam-ip-block.getPlanTopologyResponse.PlanName + ' is not the same as input '+$eipam-ip-block.planName`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='pool-index'
+ value='`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails[$resp-index].Level - 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.final.key-value' value="" />
+ </set>
+ <set>
+ <parameter name='tmp.getPlanTopologyResponse.key-name'
+ value='`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails[$resp-index].KeyName`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$tmp.getPlanTopologyResponse.key-name`" />
+ <parameter name="regex" value=":" />
+ <parameter name="ctx_memory_result_key" value="tmp.split.key-name" />
+ </execute>
+ <for index="split-index" start="0" end="`$tmp.split.key-name_length`">
+ <set>
+ <parameter name='tmp.eipam.key-name'
+ value='`$tmp.split.key-name[$split-index]`' />
+ </set>
+ <block atomic='true'>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT key_value_source from ADDRESS_PLAN_POLICIES WHERE key_name = $tmp.eipam.key-name '
+ pfx='db.address-plan-policies'>
+ <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 ADDRESS_PLAN_POLICIES 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 ADDRESS_PLAN_POLICIES entry found for key_name = ' + $eipam-ip-block.getPlanTopologyResponse.TopologyDetails[$key-index].KeyName`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from ROUTING_CHARACTERISTIC_MAPPING WHERE network_role = $generate-FQPN-input.network-role '
+ pfx='db.routing-characteristic_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 ROUTING_CHARACTERISTIC_MAPPING 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 ROUTING_CHARACTERISTIC_MAPPING entry found for network_role = ' + $generate-FQPN-input.network-role`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.key-value' value='' />
+ </set>
+ <switch test='`$db.address-plan-policies.key-value-source`'>
+ <outcome value='AddressPlanPolicyDG-Routing_Characteristic'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.key-value' value='-1' />
+ </set>
+ <switch test='`$db.routing-characteristic_mapping_length &gt; 1`'>
+ <outcome value='true'>
+ <block>
+ <for index="routing-index" start="0" end="`$db.routing-characteristic_mapping_length`">
+ <switch test='`$db.routing-characteristic_mapping[$routing-index].vrf-name == $generate-FQPN-input.vrf-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.key-value' value='`$db.routing-characteristic_mapping[$routing-index].routing-characteristic`' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <return status='success'></return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.key-value' value='`$db.routing-characteristic_mapping[0].routing-characteristic`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.key-value`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No matching ROUTING_CHARACTERISTIC_MAPPING.vrf-name found" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Location_Clli8'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.location-clli8`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Vrf_Name'>
+ <switch test='`$generate-FQPN-input.vrf-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.key-value' value='`$db.routing-characteristic_mapping[0].vrf-name`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='cloud_region_id'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.aic-cloud-region`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Complex_region'>
+ <set>
+ <parameter name='tmp.key-value' value='`$aai.complex.region`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Network_Name'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.network-name`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Subnet_Role'>
+ <switch test='`$generate-FQPN-input.subnet-role`' >
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.key-value' value='STATIC' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.subnet-role`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Network_Role'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.network-role`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Network_Id'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.network-id`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Network_Collection'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.network-collection`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Zone'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.zone`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unknown ADDRESS_PLAN_POLICIES: ' + $db.address-plan-policies.key-value-source`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ <switch test='`$split-index == 0`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.final.key-value' value="`$tmp.key-value`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.final.key-value'
+ value="`$tmp.final.key-value + ':' + $tmp.key-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='generate-FQPN-output.pools[$pool-index].key-name'
+ value='`$tmp.getPlanTopologyResponse.key-name`' />
+ <parameter name='generate-FQPN-output.pools[$pool-index].key-value'
+ value='`$tmp.final.key-value`' />
+ </set>
+ </for>
+ <set>
+ <parameter name='generate-FQPN-output.pools_length'
+ value='`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic='true'>
+ <for index="resp-index" start="0" end="`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length`">
+ <switch test='`$eipam-ip-block.plan-name == $eipam-ip-block.getPlanTopologyResponse.PlanName`'>
+ <outcome value='false'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'eipam response plan-name ['+ $eipam-ip-block.getPlanTopologyResponse.PlanName + ' is not the same as input '+$eipam-ip-block.planName`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='pool-index'
+ value='`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails[$resp-index].Level - 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.final.key-value' value="" />
+ </set>
+ <set>
+ <parameter name='tmp.getPlanTopologyResponse.key-name'
+ value='`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails[$resp-index].KeyName`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$tmp.getPlanTopologyResponse.key-name`" />
+ <parameter name="regex" value=":" />
+ <parameter name="ctx_memory_result_key" value="tmp.split.key-name" />
+ </execute>
+ <for index="split-index" start="0" end="`$tmp.split.key-name_length`">
+ <set>
+ <parameter name='tmp.eipam.key-name'
+ value='`$tmp.split.key-name[$split-index]`' />
+ </set>
+ <block atomic='true'>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT key_value_source from ADDRESS_PLAN_POLICIES WHERE key_name = $tmp.eipam.key-name '
+ pfx='db.address-plan-policies'>
+ <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 ADDRESS_PLAN_POLICIES 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 ADDRESS_PLAN_POLICIES entry found for key_name = ' + $eipam-ip-block.getPlanTopologyResponse.TopologyDetails[$key-index].KeyName`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from ROUTING_CHARACTERISTIC_MAPPING WHERE network_role = $generate-FQPN-input.network-role '
+ pfx='db.routing-characteristic_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 ROUTING_CHARACTERISTIC_MAPPING 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 ROUTING_CHARACTERISTIC_MAPPING entry found for network_role = ' + $generate-FQPN-input.network-role`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.key-value' value='' />
+ </set>
+ <switch test='`$db.address-plan-policies.key-value-source`'>
+ <outcome value='AddressPlanPolicyDG-Routing_Characteristic'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.key-value' value='-1' />
+ </set>
+ <switch test='`$db.routing-characteristic_mapping_length &gt; 1`'>
+ <outcome value='true'>
+ <block>
+ <for index="routing-index" start="0" end="`$db.routing-characteristic_mapping_length`">
+ <switch test='`$db.routing-characteristic_mapping[$routing-index].vrf-name == $generate-FQPN-input.vrf-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.key-value' value='`$db.routing-characteristic_mapping[$routing-index].routing-characteristic`' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <return status='success'></return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.key-value' value='`$db.routing-characteristic_mapping[0].routing-characteristic`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.key-value`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No matching ROUTING_CHARACTERISTIC_MAPPING.vrf-name found" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Location_Clli8'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.location-clli8`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Vrf_Name'>
+ <switch test='`$generate-FQPN-input.vrf-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.key-value' value='`$db.routing-characteristic_mapping[0].vrf-name`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='cloud_region_id'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.aic-cloud-region`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Complex_region'>
+ <set>
+ <parameter name='tmp.key-value' value='`$aai.complex.region`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Network_Name'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.network-name`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Subnet_Role'>
+ <switch test='`$generate-FQPN-input.subnet-role`' >
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.key-value' value='STATIC' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.subnet-role`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Network_Role'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.network-role`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Network_Id'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.network-id`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Network_Collection'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.network-collection`' />
+ </set>
+ </outcome>
+ <outcome value='AddressPlanPolicyDG-Zone'>
+ <set>
+ <parameter name='tmp.key-value' value='`$generate-FQPN-input.zone`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unknown ADDRESS_PLAN_POLICIES: ' + $db.address-plan-policies.key-value-source`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ <switch test='`$split-index == 0`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.final.key-value' value="`$tmp.key-value`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.final.key-value'
+ value="`$tmp.final.key-value + ':' + $tmp.key-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='generate-FQPN-output.pools[$pool-index].key-name'
+ value='`$tmp.getPlanTopologyResponse.key-name`' />
+ <parameter name='generate-FQPN-output.pools[$pool-index].key-value'
+ value='`$tmp.final.key-value`' />
+ </set>
+ </for>
+ <set>
+ <parameter name='generate-FQPN-output.pools_length'
+ value='`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-allottedresource-id.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-allottedresource-id.xml
new file mode 100644
index 00000000..b6792ad3
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-allottedresource-id.xml
@@ -0,0 +1,68 @@
+<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="generate-allottedresource-id" mode="sync">
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.local-variables.generate-allottedresource-id." value="" />
+ <parameter name="tmp.return.generate-allottedresource-id." value="" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate-allottedresource-id.id" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <!-- Used to work around execute node bug -->
+ <parameter name="execute_failure" value="false" />
+ <!-- return parameters -->
+ <parameter name="error-message.generate-l3network-network-id" value="An error occured while generating a UUID for L3-NETWORK." />
+ </return>
+ </outcome>
+ </execute>
+ <for atomic="true" index="n" start="0" end="1" >
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $cto-api.service-type AND
+ service-instance.service-instance-id = $cto-api.port-mirror-configuration-instance-id AND
+ allotted-resource.id = $tmp.return.generate-allottedresource-id.id"
+ local-only="false"
+ pfx="tmp.local-variables.generate-allottedresource-id.ALLOTTEDRESOURCE" >
+ <outcome value='success'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.local-variables.generate-allottedresource-id.is-unique" value="0" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate-allottedresource-id.id" />
+ <outcome value='failure'>
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-allottedresource-id" value="An error occured while generating a UUID for ALLOTTED-RESOURCE." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-allottedresource-id" value="`'An error occured while checking if a generated allotted-resource-id was unique. allotted-resource-id = ' + $tmp.local-variables.generate-allottedresource-id.id`" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-allottedresource-id" value="`'An error occured while checking if a generated allotted-resource-id was unique. allotted-resource-id = ' + $tmp.local-variables.generate-allottedresource-id.id`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </for>
+ <set>
+ <parameter name="tmp.local-variables.generate-allottedresource-id." value="" />
+ </set>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-host-routes-host-route-id.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-host-routes-host-route-id.xml
new file mode 100755
index 00000000..928e3a8f
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-host-routes-host-route-id.xml
@@ -0,0 +1,67 @@
+<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="generate-host-routes-host-route-id" mode="sync">
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.local-variables.generate-host-routes-host-route-id." value="" />
+ <parameter name="tmp.return.generate-host-routes-host-route-id." value="" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate-host-routes-host-route-id.uuid" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <!-- Used to work around execute node bug -->
+ <parameter name="execute_failure" value="false" />
+ <!-- return parameters -->
+ <parameter name="error-message.generate-l3network-network-id" value="An error occured while generating a UUID for L3-NETWORK." />
+ </return>
+ </outcome>
+ </execute>
+ <for atomic="true" index="s" start="0" end="1" >
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.local.network-id
+ AND subnet.subnet-id = $tmp.return.generate-subnets-subnet-id.uuid
+ AND host-route.host-route-id = $tmp.return.generate-host-routes-host-route-id.uuid"
+ local-only="false"
+ pfx="tmp.local-variables.generate-host-routes-host-route-id.HOST_ROUTE" >
+ <outcome value='success'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.local-variables.generate-host-routes-host-route-id.is-unique" value="0" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate-host-routes-host-route-id.uuid" />
+ <outcome value='failure'>
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-host-routes-host-route-id" value="An error occured while generating a UUID for HOST_ROUTE." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-host-routes-host-route-id" value="`'An error occured while checking if a generated host-routes-host-route-id was unique. host-route-id = ' + $tmp.local-variables.generate-host-routes-host-route-id.uuid`" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-host-routes-host-route-id" value="`'An error occured while checking if a generated host-routes-host-route-id was unique. host-route-id = ' + $tmp.local-variables.generate-host-routes-host-route-id.uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </for>
+ <set>
+ <parameter name="tmp.local-variables.generate-host-routes-host-route-id." value="" />
+ </set>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-l3network-network-id.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-l3network-network-id.xml
index fbf20b2c..e44c1480 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-l3network-network-id.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-l3network-network-id.xml
@@ -1,27 +1,65 @@
-<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="generate-l3network-network-id" mode="sync"><block atomic="true"><set>
- <parameter name="tmp.local-variables.generate-l3network-network-id." value="" />
- <parameter name="tmp.return.generate-l3network-network-id." value="" /></set><execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
- <parameter name="ctx-destination" value="tmp.return.generate-l3network-network-id.uuid" /><outcome value='failure'>
-<return status='failure'>
- <!-- Used to work around execute node bug -->
- <parameter name="execute_failure" value="false" />
-
- <!-- return parameters -->
- <parameter name="error-message.generate-l3network-network-id" value="An error occured while generating a UUID for L3-NETWORK." /></return></outcome></execute><for atomic="true" index="n" start="0" end="1" ><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="l3-network"
- key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"
- local-only="false"
- pfx="tmp.local-variables.generate-l3network-network-id.L3NETWORK" ><outcome value='success'>
-<block atomic='true'><set>
- <parameter name="tmp.local-variables.generate-l3network-network-id.is-unique" value="0" /></set><execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
- <parameter name="ctx-destination" value="tmp.return.generate-l3network-network-id.uuid" /><outcome value='failure'>
-<return status="failure">
- <!-- return parameters -->
- <parameter name="error-message.generate-l3network-network-id" value="An error occured while generating a UUID for L3-NETWORK." /></return></outcome></execute></block></outcome><outcome value='not-found'>
-<block></block></outcome><outcome value='failure'>
-<return status="failure">
- <!-- return parameters -->
- <parameter name="error-message.generate-l3network-network-id" value="`'An error occured while checking if a generated l3network-network-id was unique. network-id = ' + $tmp.local-variables.generate-l3network-network-id.uuid`" /></return></outcome><outcome value="Other"><return status="failure">
- <!-- return parameters -->
- <parameter name="error-message.generate-l3network-network-id" value="`'An error occured while checking if a generated l3network-network-id was unique. network-id = ' + $tmp.local-variables.generate-l3network-network-id.uuid`" /></return></outcome></get-resource></for><set>
- <parameter name="tmp.local-variables.generate-l3network-network-id." value="" /></set></block></method></service-logic>
+<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="generate-l3network-network-id" mode="sync">
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.local-variables.generate-l3network-network-id." value="" />
+ <parameter name="tmp.return.generate-l3network-network-id." value="" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate-l3network-network-id.uuid" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <!-- Used to work around execute node bug -->
+ <parameter name="execute_failure" value="false" />
+ <!-- return parameters -->
+ <parameter name="error-message.generate-l3network-network-id" value="An error occured while generating a UUID for L3-NETWORK." />
+ </return>
+ </outcome>
+ </execute>
+ <for atomic="true" index="n" start="0" end="1" >
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"
+ local-only="false"
+ pfx="tmp.local-variables.generate-l3network-network-id.L3NETWORK" >
+ <outcome value='success'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.local-variables.generate-l3network-network-id.is-unique" value="0" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate-l3network-network-id.uuid" />
+ <outcome value='failure'>
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-l3network-network-id" value="An error occured while generating a UUID for L3-NETWORK." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-l3network-network-id" value="`'An error occured while checking if a generated l3network-network-id was unique. network-id = ' + $tmp.local-variables.generate-l3network-network-id.uuid`" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-l3network-network-id" value="`'An error occured while checking if a generated l3network-network-id was unique. network-id = ' + $tmp.local-variables.generate-l3network-network-id.uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </for>
+ <set>
+ <parameter name="tmp.local-variables.generate-l3network-network-id." value="" />
+ </set>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-panorama-name.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-panorama-name.xml
index dde17098..b31a9ff6 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-panorama-name.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-panorama-name.xml
@@ -1,97 +1,136 @@
-<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='generate-panorama-name' mode='sync'>
-<block atomic="true"><set>
-<parameter name='tmp.trust-sz' value='$TenantOAMNetworkRole_$LandingNetworkRole_T' />
-<parameter name='tmp.untrust-sz' value='$TenantOAMNetworkRole_$LandingNetworkRole_U' />
-</set><set>
-<parameter name='original-name' value='`$security-zone-topology-operation-input.security-zone-request-input.untrusted-network-role`' />
-</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
- <parameter name="original_string" value="`$original-name`" />
- <parameter name="regex" value="\."/>
- <parameter name="limit" value="2" />
- <parameter name="ctx_memory_result_key" value="splits" />
-
-</execute><switch test='`$splits_length`'>
-<outcome value='1'>
-<set>
-<parameter name='new-name' value='`$splits[0]`' />
-</set></outcome><outcome value='2'>
-<set>
-<parameter name='new-name' value='`$splits[1]`' />
-</set></outcome><outcome value='Other'>
-<return status='failure'>
-<parameter name='error-code' value='500' />
-<parameter name='error-message' value='Unexpected network role used for panorama naming' />
-</return></outcome></switch><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='getLength' >
- <parameter name="source" value="`$new-name`" />
- <parameter name="outputPath" value="tmp.strlen"/>
-
-</execute><switch test='`$tmp.strlen > 14`'>
-<outcome value='true'>
-<block atomic="true"><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring' >
- <parameter name="string" value="`$new-name`" />
- <parameter name="result" value="new-name"/>
- <parameter name="begin-index" value="0" />
- <parameter name="end-index" value="14" />
-
-</execute></block></outcome><outcome value='false'>
-<block atomic="true"><set>
-<parameter name='new-name' value='`$new-name`' />
-</set></block></outcome></switch><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.trust-sz`"/>
- <parameter name="outputPath" value="tmp.trust-sz"/>
- <parameter name="target" value="$TenantOAMNetworkRole"/>
- <parameter name="replacement" value="`$new-name`"/>
-
-</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.untrust-sz`"/>
- <parameter name="outputPath" value="tmp.untrust-sz"/>
- <parameter name="target" value="$TenantOAMNetworkRole"/>
- <parameter name="replacement" value="`$new-name`"/>
-
-</execute><set>
-<parameter name='original-name' value='`$security-zone-topology-operation-input.security-zone-request-input.trusted-network-role`' />
-</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
- <parameter name="original_string" value="`$original-name`" />
- <parameter name="regex" value="\."/>
- <parameter name="limit" value="2" />
- <parameter name="ctx_memory_result_key" value="splits" />
-
-</execute><switch test='`$splits_length`'>
-<outcome value='1'>
-<set>
-<parameter name='new-name' value='`$splits[0]`' />
-</set></outcome><outcome value='2'>
-<set>
-<parameter name='new-name' value='`$splits[1]`' />
-</set></outcome><outcome value='Other'>
-<return status='failure'>
-<parameter name='error-code' value='500' />
-<parameter name='error-message' value='Unexpected network role used for panorama naming' />
-</return></outcome></switch><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='getLength' >
- <parameter name="source" value="`$new-name`" />
- <parameter name="outputPath" value="tmp.strlen"/>
-
-</execute><switch test='`$tmp.strlen > 14`'>
-<outcome value='true'>
-<block atomic="true"><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring' >
- <parameter name="string" value="`$new-name`" />
- <parameter name="result" value="new-name"/>
- <parameter name="begin-index" value="0" />
- <parameter name="end-index" value="14" />
-
-</execute></block></outcome><outcome value='false'>
-<block atomic="true"><set>
-<parameter name='new-name' value='`$new-name`' />
-</set></block></outcome></switch><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.trust-sz`"/>
- <parameter name="outputPath" value="tmp.trust-sz"/>
- <parameter name="target" value="$LandingNetworkRole"/>
- <parameter name="replacement" value="`$new-name`"/>
-
-</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.untrust-sz`"/>
- <parameter name="outputPath" value="tmp.untrust-sz"/>
- <parameter name="target" value="$LandingNetworkRole"/>
- <parameter name="replacement" value="`$new-name`"/>
-
-</execute></block></method></service-logic>
+<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='generate-panorama-name' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.trust-sz' value='$TenantOAMNetworkRole_$LandingNetworkRole_T' />
+ <parameter name='tmp.untrust-sz' value='$TenantOAMNetworkRole_$LandingNetworkRole_U' />
+ </set>
+ <set>
+ <parameter name='original-name' value='`$security-zone-topology-operation-input.security-zone-request-input.untrusted-network-role`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$original-name`" />
+ <parameter name="regex" value="\."/>
+ <parameter name="limit" value="2" />
+ <parameter name="ctx_memory_result_key" value="splits" />
+ </execute>
+ <switch test='`$splits_length`'>
+ <outcome value='1'>
+ <set>
+ <parameter name='new-name' value='`$splits[0]`' />
+ </set>
+ </outcome>
+ <outcome value='2'>
+ <set>
+ <parameter name='new-name' value='`$splits[1]`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Unexpected network role used for panorama naming' />
+ </return>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='getLength' >
+ <parameter name="source" value="`$new-name`" />
+ <parameter name="outputPath" value="tmp.strlen"/>
+ </execute>
+ <switch test='`$tmp.strlen > 14`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring' >
+ <parameter name="string" value="`$new-name`" />
+ <parameter name="result" value="new-name"/>
+ <parameter name="begin-index" value="0" />
+ <parameter name="end-index" value="14" />
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='new-name' value='`$new-name`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.trust-sz`"/>
+ <parameter name="outputPath" value="tmp.trust-sz"/>
+ <parameter name="target" value="$TenantOAMNetworkRole"/>
+ <parameter name="replacement" value="`$new-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.untrust-sz`"/>
+ <parameter name="outputPath" value="tmp.untrust-sz"/>
+ <parameter name="target" value="$TenantOAMNetworkRole"/>
+ <parameter name="replacement" value="`$new-name`"/>
+ </execute>
+ <set>
+ <parameter name='original-name' value='`$security-zone-topology-operation-input.security-zone-request-input.trusted-network-role`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$original-name`" />
+ <parameter name="regex" value="\."/>
+ <parameter name="limit" value="2" />
+ <parameter name="ctx_memory_result_key" value="splits" />
+ </execute>
+ <switch test='`$splits_length`'>
+ <outcome value='1'>
+ <set>
+ <parameter name='new-name' value='`$splits[0]`' />
+ </set>
+ </outcome>
+ <outcome value='2'>
+ <set>
+ <parameter name='new-name' value='`$splits[1]`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Unexpected network role used for panorama naming' />
+ </return>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='getLength' >
+ <parameter name="source" value="`$new-name`" />
+ <parameter name="outputPath" value="tmp.strlen"/>
+ </execute>
+ <switch test='`$tmp.strlen > 14`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring' >
+ <parameter name="string" value="`$new-name`" />
+ <parameter name="result" value="new-name"/>
+ <parameter name="begin-index" value="0" />
+ <parameter name="end-index" value="14" />
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='new-name' value='`$new-name`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.trust-sz`"/>
+ <parameter name="outputPath" value="tmp.trust-sz"/>
+ <parameter name="target" value="$LandingNetworkRole"/>
+ <parameter name="replacement" value="`$new-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.untrust-sz`"/>
+ <parameter name="outputPath" value="tmp.untrust-sz"/>
+ <parameter name="target" value="$LandingNetworkRole"/>
+ <parameter name="replacement" value="`$new-name`"/>
+ </execute>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-subnets-subnet-id.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-subnets-subnet-id.xml
new file mode 100755
index 00000000..14ba7fe2
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-subnets-subnet-id.xml
@@ -0,0 +1,66 @@
+<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="generate-subnets-subnet-id" mode="sync">
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.local-variables.generate-subnets-subnet-id." value="" />
+ <parameter name="tmp.return.generate-subnets-subnet-id." value="" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate-subnets-subnet-id.uuid" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <!-- Used to work around execute node bug -->
+ <parameter name="execute_failure" value="false" />
+ <!-- return parameters -->
+ <parameter name="error-message.generate-l3network-network-id" value="An error occured while generating a UUID for L3-NETWORK." />
+ </return>
+ </outcome>
+ </execute>
+ <for atomic="true" index="s" start="0" end="1" >
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.local.network-id
+ AND subnet.subnet-id = $tmp.return.generate-subnets-subnet-id.uuid"
+ local-only="false"
+ pfx="tmp.local-variables.generate-subnets-subnet-id.SUBNETS" >
+ <outcome value='success'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.local-variables.generate-subnets-subnet-id.is-unique" value="0" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate-subnets-subnet-id.uuid" />
+ <outcome value='failure'>
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-subnets-subnet-id" value="An error occured while generating a UUID for SUBNETS." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-subnets-subnet-id" value="`'An error occured while checking if a generated subnets-subnet-id was unique. subnet-id = ' + $tmp.local-variables.generate-subnets-subnet-id.uuid`" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-subnets-subnet-id" value="`'An error occured while checking if a generated subnets-subnet-id was unique. subnet-id = ' + $tmp.local-variables.generate-subnets-subnet-id.uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </for>
+ <set>
+ <parameter name="tmp.local-variables.generate-subnets-subnet-id." value="" />
+ </set>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-unique-name.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-unique-name.xml
index f74af961..267a2cc0 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-unique-name.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-unique-name.xml
@@ -1,268 +1,591 @@
-<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='generate-unique-name' mode='sync'>
-<block atomic="true"><set>
-<parameter name='generate-unique-name-output.error-message' value='' />
-<parameter name='generate-unique-name-output.generated-name' value='' />
-</set><switch test='`$generate-unique-name-input.supplied-name`'>
-<outcome value='Other'>
-<block atomic="true"><switch test='`$generate-unique-name-input.name-table-type`'>
-<outcome value=''><return status='failure'>
-<parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.name-table-type not supplied' />
-</return></outcome></switch><set>
-<parameter name='tmp.gun.sql' value="`'SELECT * from GENERIC_RESOURCE_NAME WHERE type = $generate-unique-name-input.name-table-type'
+<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='generate-unique-name' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-output.error-message' value='' />
+ <parameter name='generate-unique-name-output.generated-name' value='' />
+ </set>
+ <switch test='`$generate-unique-name-input.supplied-name`'>
+ <outcome value='Other'>
+ <block atomic="true">
+ <switch test='`$generate-unique-name-input.name-table-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.name-table-type not supplied' />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.gun.sql' value="`'SELECT * from GENERIC_RESOURCE_NAME WHERE type = $generate-unique-name-input.name-table-type'
+ ' AND name = $generate-unique-name-input.supplied-name'`" />
-</set><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key="`$tmp.gun.sql`" pfx='tmp.gun.namedb'>
-
-<outcome value='failure'>
-<return status='failure'>
-<parameter name='generate-unique-name-output.error-message' value="`'Error reading the ' + $generate-unique-name-input.name-table-index + ' table'`" />
-
-</return></outcome><outcome value='not-found'>
-<block atomic="true"><set>
-<parameter name='tmp.gun.sql' value="`'insert into GENERIC_RESOURCE_NAME values ( '
-+ ' $generate-unique-name-input.name-table-type , $generate-unique-name-input.supplied-name )'`" />
-
-</set><save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value="`'Error reading the ' + $generate-unique-name-input.name-table-index + ' table'`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.sql' value="`'insert into GENERIC_RESOURCE_NAME values ( '
++ ' $generate-unique-name-input.name-table-type , $generate-unique-name-input.supplied-name , null , null, null )'`" />
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key="`$tmp.gun.sql`" pfx='pfx'>
-<outcome value='failure'>
-<return status='failure'>
-<parameter name="generate-unique-name-output.error-message" value="Failed insert into GENERIC_RESOURCE_NAME table" />
-</return></outcome></save></block></outcome><outcome value='Other'>
-<return status='failure'>
-<parameter name='generate-unique-name-output.error-message' value="`'The name ' + $generate-unique-name-input.supplied-name + ' has already been used'`" />
-
-</return></outcome></get-resource></block></outcome><outcome value=''><block atomic="true"><switch test='`$generate-unique-name-input.index-table-name`'>
-<outcome value=''><return status='failure'>
-<parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.index-table-name not supplied' />
-</return></outcome></switch><switch test='`$generate-unique-name-input.index-table-prefix-column`'>
-<outcome value=''><return status='failure'>
-<parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.index-table-prefix-column not supplied' />
-</return></outcome></switch><switch test='`$generate-unique-name-input.name-table-type`'>
-<outcome value=''><return status='failure'>
-<parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.name-table-type not supplied' />
-</return></outcome></switch><switch test='`$generate-unique-name-input.prefix`'>
-<outcome value=''><return status='failure'>
-<parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.prefix not supplied' />
-</return></outcome></switch><switch test='`$generate-unique-name-input.index-length`'>
-<outcome value=''><set>
-<parameter name='tmp.gun.list-end' value='10000' />
-</set></outcome><outcome value='1'>
-<set>
-<parameter name='tmp.gun.list-end' value='10' />
-</set></outcome><outcome value='2'>
-<set>
-<parameter name='tmp.gun.list-end' value='100' />
-</set></outcome><outcome value='3'>
-<set>
-<parameter name='tmp.gun.list-end' value='1000' />
-</set></outcome><outcome value='Other'>
-<return status='failure'>
-<parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.prefix not supplied' />
-</return></outcome></switch><set>
-<parameter name='tmp.gun.sql' value="`'SELECT * from ' + $generate-unique-name-input.index-table-name
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="Failed insert into GENERIC_RESOURCE_NAME table" />
+ </return>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value="`'The name ' + $generate-unique-name-input.supplied-name + ' has already been used'`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic="true">
+ <switch test='`$generate-unique-name-input.index-table-name`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.index-table-name not supplied' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generate-unique-name-input.index-table-prefix-column`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.index-table-prefix-column not supplied' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generate-unique-name-input.name-table-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.name-table-type not supplied' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generate-unique-name-input.prefix`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.prefix not supplied' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generate-unique-name-input.index-length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.gun.list-end' value='100000' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='tmp.gun.list-end' value='0' />
+ </set>
+ </outcome>
+ <outcome value='1'>
+ <set>
+ <parameter name='tmp.gun.list-end' value='10' />
+ </set>
+ </outcome>
+ <outcome value='2'>
+ <set>
+ <parameter name='tmp.gun.list-end' value='100' />
+ </set>
+ </outcome>
+ <outcome value='3'>
+ <set>
+ <parameter name='tmp.gun.list-end' value='1000' />
+ </set>
+ </outcome>
+ <outcome value='4'>
+ <set>
+ <parameter name='tmp.gun.list-end' value='10000' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.prefix not supplied' />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.gun.noindex-flag' value='false' />
+ </set>
+ <set>
+ <parameter name='tmp.gun.sql' value="`'SELECT * from ' + $generate-unique-name-input.index-table-name
+ ' WHERE ' + $generate-unique-name-input.index-table-prefix-column + ' = '
+ '$generate-unique-name-input.prefix'`" />
-</set><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key="`$tmp.gun.sql`" pfx='tmp.gun.prefixdb'>
-
-<outcome value='success'>
-<block>
-<set>
-<parameter name='tmp.gun.index-exists' value='true' />
-</set><set>
-<parameter name='tmp.gun.index-number' value='`$tmp.gun.prefixdb.index-number + 1`' />
-</set></block></outcome><outcome value='not-found'>
-<block>
-<set>
-<parameter name='tmp.gun.index-exists' value='false' />
-</set><set>
-<parameter name='tmp.gun.index-number' value='1' />
-</set></block></outcome><outcome value='failure'>
-<return status='failure'>
- <parameter name="generate-unique-name-output.error-message" value="`'Error reading the ' + $generate-unique-name-input.index-table-name + ' table'`" />
-</return></outcome></get-resource><set>
-<parameter name='tmp.gun.found-flag' value='false' />
-</set><block>
-<for index='tmp.gun.idx' start='`$tmp.gun.index-number`' end='`$tmp.gun.list-end`' >
-<block atomic="true"><switch test='`$generate-unique-name-input.index-length`'>
-<outcome value=''><set>
-<parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
-</set></outcome><outcome value='1'>
-<set>
-<parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
-</set></outcome><outcome value='2'>
-<switch test='`$tmp.gun.idx &lt; 10`'>
-<outcome value='true'>
-<set>
-<parameter name='tmp.gun.index-string' value="`'' + '0' + $tmp.gun.idx`" />
-</set></outcome><outcome value='false'>
-<set>
-<parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
-</set></outcome></switch></outcome><outcome value='3'>
-<switch test='`$tmp.gun.idx &lt; 10`'>
-<outcome value='true'>
-<set>
-<parameter name='tmp.gun.index-string' value="`'' + '00' + $tmp.gun.idx`" />
-</set></outcome><outcome value='false'>
-<switch test='`$tmp.gun.idx &lt; 100`'>
-<outcome value='true'>
-<set>
-<parameter name='tmp.gun.index-string' value="`'' + '0' + $tmp.gun.idx`" />
-</set></outcome><outcome value='false'>
-<set>
-<parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
-</set></outcome></switch></outcome></switch></outcome></switch><set>
-<parameter name='tmp.gun.generated-name' value='`$generate-unique-name-input.prefix + $tmp.gun.index-string`' />
-</set><set>
-<parameter name='tmp.gun.sql' value="`'SELECT * from GENERIC_RESOURCE_NAME WHERE type = $generate-unique-name-input.name-table-type'
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='tmp.gun.index-exists' value='true' />
+ </set>
+ <switch test='`$generate-unique-name-input.index-length`'>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.gun.index-number' value='`$tmp.gun.prefixdb.index-number + 1`' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='tmp.gun.index-number' value='0' />
+ </set>
+ <set>
+ <parameter name='tmp.gun.noindex-flag' value='true' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='tmp.gun.index-exists' value='false' />
+ </set>
+ <switch test='`$generate-unique-name-input.index-length`'>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='tmp.gun.index-number' value='0' />
+ </set>
+ <set>
+ <parameter name='tmp.gun.noindex-flag' value='true' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.gun.index-number' value='1' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="`'Error reading the ' + $generate-unique-name-input.index-table-name + ' table'`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.gun.found-flag' value='false' />
+ </set>
+ <block>
+ <for index='tmp.gun.idx' start='`$tmp.gun.index-number`' end='`$tmp.gun.list-end`' >
+ <block atomic="true">
+ <switch test='`$generate-unique-name-input.index-length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
+ </set>
+ </outcome>
+ <outcome value='1'>
+ <set>
+ <parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
+ </set>
+ </outcome>
+ <outcome value='2'>
+ <switch test='`$tmp.gun.idx &lt; 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.gun.index-string' value="`'' + '0' + $tmp.gun.idx`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='3'>
+ <switch test='`$tmp.gun.idx &lt; 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.gun.index-string' value="`'' + '00' + $tmp.gun.idx`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.gun.idx &lt; 100`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.gun.index-string' value="`'' + '0' + $tmp.gun.idx`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='4'>
+ <switch test='`$tmp.gun.idx &lt; 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.gun.index-string' value="`'' + '000' + $tmp.gun.idx`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.gun.idx &lt; 100`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.gun.index-string' value="`'' + '00' + $tmp.gun.idx`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.gun.idx &lt; 1000`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.gun.index-string' value="`'' + '0' + $tmp.gun.idx`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.gun.generated-name' value='`$generate-unique-name-input.prefix + $tmp.gun.index-string`' />
+ </set>
+ <set>
+ <parameter name='tmp.gun.sql' value="`'SELECT * from GENERIC_RESOURCE_NAME WHERE type = $generate-unique-name-input.name-table-type'
+ ' AND name = $tmp.gun.generated-name'`" />
-</set><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key="`$tmp.gun.sql`" pfx='tmp.gun.namedb'>
-
-<outcome value='failure'>
-<block atomic="true"><set>
-<parameter name='generate-unique-name-output.error-message' value="`'Error reading the GENERIC_RESOURCE_NAME table'`" />
-</set><return status='failure'>
-</return></block></outcome><outcome value='not-found'>
-<block atomic="true"><set>
-<parameter name='tmp.gun.found-flag' value='true' />
-</set><return status='failure'>
-</return></block></outcome></get-resource></block></for><return status='success'>
-
-</return></block><switch test='`$generate-unique-name-output.error-message`'>
-<outcome value=''><block>
-</block></outcome><outcome value='Other'>
-<return status='failure'>
-</return></outcome></switch><switch test='`$tmp.gun.found-flag`'>
-<outcome value='true'><block atomic="true"><set>
-<parameter name='generate-unique-name-output.generated-name' value='`$tmp.gun.generated-name`' />
-</set><switch test='`$tmp.gun.index-exists`'>
-<outcome value='true'>
-<block atomic="true"><set>
-<parameter name='tmp.gun.sql' value="`'update ' + $generate-unique-name-input.index-table-name
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-output.error-message' value="`'Error reading the GENERIC_RESOURCE_NAME table'`" />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.found-flag' value='true' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </for>
+ <switch test='`$tmp.gun.noindex-flag`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.index-string' value='0' />
+ </set>
+ <set>
+ <parameter name='tmp.gun.generated-name' value='`$generate-unique-name-input.prefix`' />
+ </set>
+ <set>
+ <parameter name='tmp.gun.sql' value="`'SELECT * from GENERIC_RESOURCE_NAME WHERE type = $generate-unique-name-input.name-table-type'
++ ' AND name = $tmp.gun.generated-name'`" />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.gun.sql`" pfx='tmp.gun.namedb'>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-output.error-message' value="`'Error reading the GENERIC_RESOURCE_NAME table'`" />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.found-flag' value='true' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.found-flag' value='true' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ <return status='success'></return>
+ </block>
+ <switch test='`$generate-unique-name-output.error-message`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'></return>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.gun.found-flag`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-output.generated-name' value='`$tmp.gun.generated-name`' />
+ </set>
+ <switch test='`$tmp.gun.index-exists`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.sql' value="`'update ' + $generate-unique-name-input.index-table-name
+ ' set index_number = ' + $tmp.gun.index-string + ' where '
+ $generate-unique-name-input.index-table-prefix-column
+ ' = $generate-unique-name-input.prefix'`" />
-</set><save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key="`$tmp.gun.sql`" pfx='pfx'>
-<outcome value='failure'>
-<return status='failure'>
- <parameter name="generate-unique-name-output.error-message" value="`'Failed to update ' + $generate-unique-name-input.index-table-name + ' table'`" />
-</return></outcome></save></block></outcome><outcome value='false'>
-<block atomic="true"><set>
-<parameter name='tmp.gun.sql' value="`'insert into ' + $generate-unique-name-input.index-table-name
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="`'Failed to update ' + $generate-unique-name-input.index-table-name + ' table'`" />
+ </return>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.sql' value="`'insert into ' + $generate-unique-name-input.index-table-name
+ '(' + $generate-unique-name-input.index-table-prefix-column + ', index_number) values ('
+ ' $generate-unique-name-input.prefix , ' + $tmp.gun.index-string + ')'`" />
-
-</set><save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key="`$tmp.gun.sql`" pfx='pfx'>
-<outcome value='failure'>
-<return status='failure'>
- <parameter name="generate-unique-name-output.error-message" value="`'Failed to insert record into ' + $generate-unique-name-input.index-table-name + ' table'`" />
-</return></outcome></save></block></outcome></switch><set>
-<parameter name='tmp.gun.sql' value="`'insert into GENERIC_RESOURCE_NAME values ( '
-+ ' $generate-unique-name-input.name-table-type , $tmp.gun.generated-name )'`" />
-
-</set><save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="`'Failed to insert record into ' + $generate-unique-name-input.index-table-name + ' table'`" />
+ </return>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.gun.sql'
+ value="`'insert into GENERIC_RESOURCE_NAME values ( $generate-unique-name-input.name-table-type , $tmp.gun.generated-name , $generate-unique-name-input.prefix , ' + $tmp.gun.index-string + ' , $tmp.gun.transient )'`" />
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key="`$tmp.gun.sql`" pfx='pfx'>
-<outcome value='failure'>
-<return status='failure'>
- <parameter name="generate-unique-name-output.error-message" value="Failed insert into GENERIC_RESOURCE_NAME table" />
-</return></outcome></save><return status='success'>
-</return></block></outcome><outcome value='false'>
-<block atomic="true"><switch test='`$generate-unique-name-input.index-length`'>
-<outcome value=''><return status='failure'>
- <parameter name="generate-unique-name-output.error-message" value="We have exhausted the naming index count" />
-</return></outcome></switch><block>
-<for index='tmp.gun.idx' start='1' end='`$tmp.gun.index-number`' >
-<block atomic="true"><switch test='`$generate-unique-name-input.index-length`'>
-<outcome value=''><set>
-<parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
-</set></outcome><outcome value='1'>
-<set>
-<parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
-</set></outcome><outcome value='2'>
-<switch test='`$tmp.gun.idx &lt; 10`'>
-<outcome value='true'>
-<set>
-<parameter name='tmp.gun.index-string' value="`'' + '0' + $tmp.gun.idx`" />
-</set></outcome><outcome value='false'>
-<set>
-<parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
-</set></outcome></switch></outcome><outcome value='3'>
-<switch test='`$tmp.gun.idx &lt; 10`'>
-<outcome value='true'>
-<set>
-<parameter name='tmp.gun.index-string' value="`'' + '00' + $tmp.gun.idx`" />
-</set></outcome><outcome value='false'>
-<switch test='`$tmp.gun.idx &lt; 100`'>
-<outcome value='true'>
-<set>
-<parameter name='tmp.gun.index-string' value="`'' + '0' + $tmp.gun.idx`" />
-</set></outcome><outcome value='false'>
-<set>
-<parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
-</set></outcome></switch></outcome></switch></outcome></switch><set>
-<parameter name='tmp.gun.generated-name' value='`$generate-unique-name-input.prefix + $tmp.gun.index-string`' />
-</set><set>
-<parameter name='tmp.gun.namedb.name' value='' />
-</set><set>
-<parameter name='tmp.gun.sql' value="`'SELECT * from GENERIC_RESOURCE_NAME WHERE type = $generate-unique-name-input.name-table-type'
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="Failed insert into GENERIC_RESOURCE_NAME table" />
+ </return>
+ </outcome>
+ </save>
+ <return status='success'></return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$tmp.gun.noindex-flag`'>
+ <outcome value='true'>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="naming exhausted for input with index-length = 0" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generate-unique-name-input.index-length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="We have exhausted the naming index count" />
+ </return>
+ </outcome>
+ </switch>
+ <block>
+ <for index='tmp.gun.idx' start='1' end='`$tmp.gun.index-number`' >
+ <block atomic="true">
+ <switch test='`$generate-unique-name-input.index-length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
+ </set>
+ </outcome>
+ <outcome value='1'>
+ <set>
+ <parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
+ </set>
+ </outcome>
+ <outcome value='2'>
+ <switch test='`$tmp.gun.idx &lt; 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.gun.index-string' value="`'' + '0' + $tmp.gun.idx`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='3'>
+ <switch test='`$tmp.gun.idx &lt; 10`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.gun.index-string' value="`'' + '00' + $tmp.gun.idx`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.gun.idx &lt; 100`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.gun.index-string' value="`'' + '0' + $tmp.gun.idx`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.gun.generated-name' value='`$generate-unique-name-input.prefix + $tmp.gun.index-string`' />
+ </set>
+ <set>
+ <parameter name='tmp.gun.namedb.name' value='' />
+ </set>
+ <set>
+ <parameter name='tmp.gun.sql' value="`'SELECT * from GENERIC_RESOURCE_NAME WHERE type = $generate-unique-name-input.name-table-type'
+ ' AND name = $tmp.gun.generated-name'`" />
-</set><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key="`$tmp.gun.sql`" pfx='tmp.gun.namedb'>
-
-<outcome value='failure'>
-<block atomic="true"><set>
-<parameter name='generate-unique-name-output.error-message' value="Error reading the GENERIC_RESOURCE_NAME table" />
-</set><return status='failure'>
-</return></block></outcome><outcome value='not-found'>
-<block atomic="true"><set>
-<parameter name='tmp.gun.found-flag' value='true' />
-</set><return status='failure'>
-</return></block></outcome></get-resource></block></for><return status='success'>
-
-</return></block><switch test='`$generate-unique-name-output.error-message`'>
-<outcome value=''><block>
-</block></outcome><outcome value='Other'>
-<return status='failure'>
-</return></outcome></switch><switch test='`$tmp.gun.found-flag`'>
-<outcome value='true'><block atomic="true"><set>
-<parameter name='generate-unique-name-output.generated-name' value='`$tmp.gun.generated-name`' />
-</set><switch test='`$tmp.gun.index-exists`'>
-<outcome value='true'>
-<block atomic="true"><set>
-<parameter name='tmp.gun.sql' value="`'update ' + $generate-unique-name-input.index-table-name
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-output.error-message' value="Error reading the GENERIC_RESOURCE_NAME table" />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.found-flag' value='true' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </for>
+ <return status='success'></return>
+ </block>
+ <switch test='`$generate-unique-name-output.error-message`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'></return>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.gun.found-flag`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-output.generated-name' value='`$tmp.gun.generated-name`' />
+ </set>
+ <switch test='`$tmp.gun.index-exists`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.sql' value="`'update ' + $generate-unique-name-input.index-table-name
+ ' set index_number = ' + $tmp.gun.index-string + ' where '
+ $generate-unique-name-input.index-table-prefix-column
+ ' = $generate-unique-name-input.prefix'`" />
-</set><save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key="`$tmp.gun.sql`" pfx='pfx'>
-<outcome value='failure'>
-<return status='failure'>
- <parameter name="generate-unique-name-output.error-message" value="`'Failed to update ' + $generate-unique-name-input.index-table-name + ' table'`" />
-</return></outcome></save></block></outcome><outcome value='false'>
-<block atomic="true"><set>
-<parameter name='tmp.gun.sql' value="`'insert into ' + $generate-unique-name-input.index-table-name
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="`'Failed to update ' + $generate-unique-name-input.index-table-name + ' table'`" />
+ </return>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.gun.sql' value="`'insert into ' + $generate-unique-name-input.index-table-name
+ '(' + $generate-unique-name-input.index-table-prefix-column + ', index_number) values ('
+ ' $generate-unique-name-input.prefix , ' + $tmp.gun.index-string + ')'`" />
-
-</set><save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key="`$tmp.gun.sql`" pfx='pfx'>
-<outcome value='failure'>
-<return status='failure'>
- <parameter name="generate-unique-name-output.error-message" value="`'Failed to insert record into ' + $generate-unique-name-input.index-table-name + ' table'`" />
-</return></outcome></save></block></outcome></switch><set>
-<parameter name='tmp.gun.sql' value="`'insert into GENERIC_RESOURCE_NAME values ( '
-+ ' $generate-unique-name-input.name-table-type , $tmp.gun.generated-name )'`" />
-
-</set><save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="`'Failed to insert record into ' + $generate-unique-name-input.index-table-name + ' table'`" />
+ </return>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.gun.sql'
+ value="`'insert into GENERIC_RESOURCE_NAME values ( $generate-unique-name-input.name-table-type , $tmp.gun.generated-name , $generate-unique-name-input.prefix , ' + $tmp.gun.index-string + ' , $tmp.gun.transient )'`" />
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key="`$tmp.gun.sql`" pfx='pfx'>
-<outcome value='failure'>
-<return status='failure'>
- <parameter name="generate-unique-name-output.error-message" value="Failed insert into GENERIC_RESOURCE_NAME table" />
-</return></outcome></save><return status='success'>
-
-</return></block></outcome></switch><return status='failure'>
- <parameter name="generate-unique-name-output.error-message" value="We have exhausted the naming index count" />
-</return></block></outcome></switch></block></outcome></switch></block></method></service-logic>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="Failed insert into GENERIC_RESOURCE_NAME table" />
+ </return>
+ </outcome>
+ </save>
+ <return status='success'></return>
+ </block>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name="generate-unique-name-output.error-message" value="We have exhausted the naming index count" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-vpn-binding-id.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-vpn-binding-id.xml
new file mode 100755
index 00000000..1a981fa8
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-vpn-binding-id.xml
@@ -0,0 +1,65 @@
+<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="generate-vpn-binding-id" mode="sync">
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.local-variables.generate-vpn-binding-id." value="" />
+ <parameter name="tmp.return.generate-vpn-binding-id." value="" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate-vpn-binding-id.uuid" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <!-- Used to work around execute node bug -->
+ <parameter name="execute_failure" value="false" />
+ <!-- return parameters -->
+ <parameter name="error-message.generate-vpn-binding-id" value="An error occured while generating a UUID for VPN-BINDING." />
+ </return>
+ </outcome>
+ </execute>
+ <for atomic="true" index="n" start="0" end="1" >
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-binding.vpn-id = $tmp.return.generate-vpn-binding-id.uuid"
+ local-only="false"
+ pfx="tmp.local-variables.generate-vpn-binding-id.VPNBINDING" >
+ <outcome value='success'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.local-variables.generate-vpn-binding-id.is-unique" value="0" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate-vpn-binding-id.uuid" />
+ <outcome value='failure'>
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-vpn-binding-id" value="An error occured while generating a UUID for VPN-BINDING." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-vpn-binding-id" value="`'An error occured while checking if a generated vpn-binding-id was unique. vpn-id = ' + $tmp.local-variables.generate-vpn-binding-id.uuid`" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <!-- return parameters -->
+ <parameter name="error-message.generate-vpn-binding-id" value="`'An error occured while checking if a generated vpn-binding-id was unique. vpn-id = ' + $tmp.local-variables.generate-vpn-binding-id.uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </for>
+ <set>
+ <parameter name="tmp.local-variables.generate-vpn-binding-id." value="" />
+ </set>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generic-configuration-notification-activate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generic-configuration-notification-activate.xml
new file mode 100755
index 00000000..3ee1bbc1
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generic-configuration-notification-activate.xml
@@ -0,0 +1,108 @@
+<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='generic-configuration-notification-activate' mode='sync'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.gc-configuration`"/>
+ <parameter name="outputPath" value="tmp.gc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.configuration-information.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.gc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-gc" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="`'Cannot find configuration ' + $generic-configuration-notification-input.configuration-information.configuration-id`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find configuration ' + $generic-configuration-notification-input.configuration-information.configuration-id`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='mdsal-gc.gc-configuration[0].configuration-data.configuration-oper-status.order-status'
+ value='Active' />
+ <parameter name='mdsal-gc.gc-configuration[0].configuration-data.configuration-oper-status.last-action'
+ value='CreateGenericConfigurationInstance' />
+ <parameter name='mdsal-gc.gc-configuration[0].configuration-data.configuration-oper-status.last-rpc-action'
+ value='activate' />
+ </set>
+ <set>
+ <parameter name='gc.' value='mdsal-gc.gc-configuration[0].' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.genconfig.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.gc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-gc" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Error updating md-sal for gc-configuration' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Error updating md-sal for gc-configuration' />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="`$generic-configuration-notification-input.ack-final-indicator`" />
+ <parameter name="input.response-code"
+ value="`$generic-configuration-notification-input.response-code`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-gcnotify.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="success" />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generic-configuration-notification-assign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generic-configuration-notification-assign.xml
new file mode 100755
index 00000000..5db9776a
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generic-configuration-notification-assign.xml
@@ -0,0 +1,485 @@
+<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='generic-configuration-notification-assign' mode='sync'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.gc-configuration`"/>
+ <parameter name="outputPath" value="tmp.gc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.configuration-information.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.gc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-gc" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="`'Cannot find configuration ' + $generic-configuration-notification-input.configuration-information.configuration-id`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find configuration ' + $generic-configuration-notification-input.configuration-information.configuration-id`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <switch test='`$generic-configuration-notification-input.response-code`'>
+ <outcome value='Other'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="`$generic-configuration-notification-input.ack-final-indicator`" />
+ <parameter name="input.response-code"
+ value="`$generic-configuration-notification-input.response-code`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`$generic-configuration-notification-input.response-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='200'>
+ <block></block>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.provided-configurations.provided-configuration_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.provided-configurations.provided-configuration_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='found-provided-configuration' value='false' />
+ </set>
+ <set>
+ <parameter name='pc-index' value='0' />
+ </set>
+ <for silentFailure='true' index='pc-index' start='0' end='`$service-data.provided-configurations.provided-configuration_length`' >
+ <switch test='`$service-data.provided-configurations.provided-configuration[$pc-index].configuration-id
+ == $generic-configuration-notification-input.configuration-information.configuration-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-provided-configuration' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-provided-configuration`'>
+ <outcome value='false'>
+ <set>
+ <parameter name='service-data.provided-configurations.provided-configuration_length'
+ value='`$service-data.provided-configurations.provided-configuration_length + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.provided-configurations.provided-configuration[$pc-index].configuration-id'
+ value='`$generic-configuration-notification-input.configuration-information.configuration-id`' />
+ <parameter name='service-data.provided-configurations.provided-configuration[$pc-index].configuration-type'
+ value='`$generic-configuration-notification-input.configuration-information.configuration-type`' />
+ <parameter name='service-data.provided-configurations.provided-configuration[$pc-index].configuration-sub-type'
+ value='`$generic-configuration-notification-input.configuration-information.configuration-sub-type`' />
+ <parameter name='service-data.provided-configurations.provided-configuration[$pc-index].configuration-topology-link'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $generic-configuration-notification-input.service-information.service-instance-id
+ + '/service-data/provided-configurations/provided-configuration/'
+ + $generic-configuration-notification-input.configuration-information.configuration-id`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vnf-sub-interface-group`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.vnf-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.vnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{vnfc-instance-group-function}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.vnfc-instance-group-function`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{network-instance-group-function}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.network-instance-group-function`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.vsig-url"/>
+ <parameter name="target" value="{parent-port-role}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.parent-port-role`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vsig-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-vsig" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="`'Cannot find vnf-sub-interface-group in service ' + $generic-configuration-notification-input.vnr-parameters.vnf-service-instance-id`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find vnf-sub-interface-group in service ' + $generic-configuration-notification-input.vnr-parameters.vnf-service-instance-id`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc_length`' >
+ <for silentFailure='true' index='vnic-index' start='0' end='`$mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc[$vnfc-index].vnics.vnic_length`' >
+ <for silentFailure='true' index='si-index' start='0' end='`$mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc[$vnfc-index].vnics.vnic[$vnic-index].sub-interfaces.sub-interface_length`' >
+ <switch test='`$mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc[$vnfc-index].vnics.vnic[$vnic-index].sub-interfaces.sub-interface[$si-index].vlan-tags.lower-tag-id
+ == $generic-configuration-notification-input.vnr-parameters.lower-tag-id`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc[$vnfc-index].vnics.vnic[$vnic-index].sub-interfaces.sub-interface[$si-index].sub-interface-status'
+ value='assigned' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </for>
+ <switch test='`$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length'
+ value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='found-customer-bonding-request' value='false' />
+ </set>
+ <for index='cbr-index' start='0' end='`$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length`' >
+ <switch test='`$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request[$cbr-index].configuration-id
+ == $generic-configuration-notification-input.configuration-information.configuration-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-customer-bonding-request' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-customer-bonding-request`'>
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request[$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length].configuration-id'
+ value='`$generic-configuration-notification-input.configuration-information.configuration-id`' />
+ </set>
+ <set>
+ <parameter name='mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length'
+ value='`$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.vnfsubinterfacegroup.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vsig-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-vsig" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="Failure writing vnf-sub-interface-group" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failure writing vnf-sub-interface-group" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.network-instance-group-network`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.network-collection-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{network-instance-group-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.network-instance-group-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.nign-url"/>
+ <parameter name="target" value="{network-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.network-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.nign-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-nign" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="`'Cannot find network-instance-group-network in service ' + $generic-configuration-notification-input.vnr-parameters.network-collection-service-instance-id`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find network-instance-group-network in service ' + $generic-configuration-notification-input.vnr-parameters.network-collection-service-instance-id`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <switch test='`$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length'
+ value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='found-customer-bonding-request' value='false' />
+ </set>
+ <set>
+ <parameter name='cbr-index' value='0' />
+ </set>
+ <for index='cbr-index' start='0' end='`$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length`' >
+ <switch test='`$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request[$cbr-index].configuration-id
+ == $generic-configuration-notification-input.configuration-information.configuration-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-customer-bonding-request' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-customer-bonding-request`'>
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request[$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length].configuration-id'
+ value='`$generic-configuration-notification-input.configuration-information.configuration-id`' />
+ </set>
+ <set>
+ <parameter name='mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length'
+ value='`$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='mdsal-nign.network[0].network-status' value='assigned' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-instance-group-network.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.nign-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-nign" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="Failure writing network-instance-group network" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failure writing network-instance-group network" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='mdsal-gc.gc-configuration[0].configuration-data.configuration-oper-status.order-status'
+ value='Created' />
+ </set>
+ <set>
+ <parameter name='gc.' value='mdsal-gc.gc-configuration[0].' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.genconfig.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.gc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-gc" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="Error updating md-sal for gc-configuration" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Error updating md-sal for gc-configuration' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="Error updating md-sal for gc-configuration" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Error updating md-sal for gc-configuration' />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="`$generic-configuration-notification-input.ack-final-indicator`" />
+ <parameter name="input.response-code"
+ value="`$generic-configuration-notification-input.response-code`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-gcnotify.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="success" />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generic-configuration-notification-deactivate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generic-configuration-notification-deactivate.xml
new file mode 100755
index 00000000..88fcf350
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generic-configuration-notification-deactivate.xml
@@ -0,0 +1,108 @@
+<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='generic-configuration-notification-deactivate' mode='sync'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.gc-configuration`"/>
+ <parameter name="outputPath" value="tmp.gc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.configuration-information.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.gc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-gc" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="`'Cannot find configuration ' + $generic-configuration-notification-input.configuration-information.configuration-id`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find configuration ' + $generic-configuration-notification-input.configuration-information.configuration-id`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='mdsal-gc.gc-configuration[0].configuration-data.configuration-oper-status.order-status'
+ value='PendingDelete' />
+ <parameter name='mdsal-gc.gc-configuration[0].configuration-data.configuration-oper-status.last-action'
+ value='DeleteGenericConfigurationInstance' />
+ <parameter name='mdsal-gc.gc-configuration[0].configuration-data.configuration-oper-status.last-rpc-action'
+ value='deactivate' />
+ </set>
+ <set>
+ <parameter name='gc.' value='mdsal-gc.gc-configuration[0].' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.genconfig.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.gc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-gc" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Error updating md-sal for gc-configuration' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Error updating md-sal for gc-configuration' />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="`$generic-configuration-notification-input.ack-final-indicator`" />
+ <parameter name="input.response-code"
+ value="`$generic-configuration-notification-input.response-code`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-gcnotify.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="success" />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generic-configuration-notification-unassign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generic-configuration-notification-unassign.xml
new file mode 100755
index 00000000..a3c5fff6
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generic-configuration-notification-unassign.xml
@@ -0,0 +1,353 @@
+<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='generic-configuration-notification-unassign' mode='sync'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <for silentFailure='true' index='pc-index' start='0' end='`$service-data.provided-configurations.provided-configuration_length`' >
+ <switch test='`$service-data.provided-configurations.provided-configuration[$pc-index].configuration-id
+ == $generic-configuration-notification-input.configuration-information.configuration-id`'>
+ <outcome value='true'>
+ <block>
+ <for index='pc2-index' start='`$pc-index + 1`' end='`$service-data.provided-configurations.provided-configuration_length`' >
+ <block>
+ <set>
+ <parameter name='prev-index' value='`$pc2-index - 1`' />
+ </set>
+ <set>
+ <parameter name='service-data.provided-configurations.provided-configuration[$prev-index].'
+ value='`$service-data.provided-configurations.provided-configuration[$pc2-index].`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.provided-configurations.provided-configuration_length'
+ value='`$service-data.provided-configurations.provided-configuration_length - 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.gc-configuration`"/>
+ <parameter name="outputPath" value="tmp.gc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.configuration-information.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.gc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-gc" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="`'Cannot find configuration ' + $generic-configuration-notification-input.configuration-information.configuration-id`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find configuration ' + $generic-configuration-notification-input.configuration-information.configuration-id`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <switch test='`$generic-configuration-notification-input.response-code`'>
+ <outcome value='Other'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="`$generic-configuration-notification-input.ack-final-indicator`" />
+ <parameter name="input.response-code"
+ value="`$generic-configuration-notification-input.response-code`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`$generic-configuration-notification-input.response-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='200'>
+ <block></block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vnf-sub-interface-group`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.vnf-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.vnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{vnfc-instance-group-function}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.vnfc-instance-group-function`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{network-instance-group-function}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.network-instance-group-function`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.vsig-url"/>
+ <parameter name="target" value="{parent-port-role}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.parent-port-role`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vsig-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-vsig" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="`'Cannot find vnf-sub-interface-group in service ' + $generic-configuration-notification-input.vnr-parameters.vnf-service-instance-id`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find vnf-sub-interface-group in service ' + $generic-configuration-notification-input.vnr-parameters.vnf-service-instance-id`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc_length`' >
+ <for silentFailure='true' index='vnic-index' start='0' end='`$mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc[$vnfc-index].vnics.vnic_length`' >
+ <for silentFailure='true' index='si-index' start='0' end='`$mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc[$vnfc-index].vnics.vnic[$vnic-index].sub-interfaces.sub-interface_length`' >
+ <switch test='`$mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc[$vnfc-index].vnics.vnic[$vnic-index].sub-interfaces.sub-interface[$si-index].vlan-tags.lower-tag-id
+ == $generic-configuration-notification-input.vnr-parameters.lower-tag-id`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='mdsal-vsig.vnf-sub-interface-group[0].vnfcs.vnfc[$vnfc-index].vnics.vnic[$vnic-index].sub-interfaces.sub-interface[$si-index].sub-interface-status'
+ value='unassigned' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </for>
+ <for index='cbr-index' start='0' end='`$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length`' >
+ <switch test='`$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request[$cbr-index].configuration-id
+ == $generic-configuration-notification-input.configuration-information.configuration-id`'>
+ <outcome value='true'>
+ <block>
+ <for index='cbr2-index' start='`$cbr-index + 1`' end='`$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length`' >
+ <block>
+ <set>
+ <parameter name='prev-index' value='`$cbr2-index - 1`' />
+ </set>
+ <set>
+ <parameter name='mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request[$cbr-index].[$prev-index].'
+ value='`$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request[$cbr-index].[$cbr2-index].`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length'
+ value='`$mdsal-vsig.vnf-sub-interface-group[0].customer-bonding-requests.customer-bonding-request_length - 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.vnfsubinterfacegroup.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vsig-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-vsig" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="Failure writing vnf-sub-interface-group" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failure writing vnf-sub-interface-group" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.network-instance-group-network`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.network-collection-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{network-instance-group-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.network-instance-group-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.part`"/>
+ <parameter name="outputPath" value="tmp.nign-url"/>
+ <parameter name="target" value="{network-id}"/>
+ <parameter name="replacement" value="`$generic-configuration-notification-input.vnr-parameters.network-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.nign-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-nign" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="`'Cannot find network-instance-group-network in service ' + $generic-configuration-notification-input.vnr-parameters.network-collection-service-instance-id`" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find network-instance-group-network in service ' + $generic-configuration-notification-input.vnr-parameters.network-collection-service-instance-id`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='mdsal-nign.network[0].network-status' value='unassigned' />
+ </set>
+ <for index='cbr-index' start='0' end='`$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length`' >
+ <switch test='`$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request[$cbr-index].configuration-id
+ == $generic-configuration-notification-input.configuration-information.configuration-id`'>
+ <outcome value='true'>
+ <block>
+ <for index='cbr2-index' start='`$cbr-index + 1`' end='`$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length`' >
+ <block>
+ <set>
+ <parameter name='prev-index' value='`$cbr2-index - 1`' />
+ </set>
+ <set>
+ <parameter name='mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request[$cbr-index].[$prev-index].'
+ value='`$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request[$cbr-index].[$cbr2-index].`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length'
+ value='`$mdsal-nign.network[0].customer-bonding-requests.customer-bonding-request_length - 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.network-instance-group-network.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.nign-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-nign" />
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url"
+ value="`$mdsal-gc.gc-configuration[0].configuration-data.configuration-operation-information.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator"
+ value="Y" />
+ <parameter name="input.response-code"
+ value="500" />
+ <parameter name="input.response-message"
+ value="Failure writing network-instance-group network" />
+ <parameter name="input.svc-request-id"
+ value="`$generic-configuration-notification-input.svc-request-id`" />
+ <parameter name="input.service-information.service-type"
+ value="`$generic-configuration-notification-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id"
+ value="`$generic-configuration-notification-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failure writing network-instance-group network" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-gcnotify.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="success" />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generic-configuration-notification.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generic-configuration-notification.xml
new file mode 100755
index 00000000..34bfcec3
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generic-configuration-notification.xml
@@ -0,0 +1,39 @@
+<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='generic-configuration-notification' mode='sync'>
+ <block atomic="true">
+ <switch test='`$generic-configuration-notification-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <call module='GENERIC-RESOURCE-API' rpc='generic-configuration-notification-assign' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='activate'>
+ <call module='GENERIC-RESOURCE-API' rpc='generic-configuration-notification-activate' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='deactivate'>
+ <call module='GENERIC-RESOURCE-API' rpc='generic-configuration-notification-deactivate' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='unassign'>
+ <call module='GENERIC-RESOURCE-API' rpc='generic-configuration-notification-unassign' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ <return status='success'></return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generic-configuration-topology-operation.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generic-configuration-topology-operation.xml
new file mode 100755
index 00000000..56f0d74b
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generic-configuration-topology-operation.xml
@@ -0,0 +1,117 @@
+<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='generic-configuration-topology-operation' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-generic-configuration-input' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <switch test='`$generic-configuration-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block atomic="true">
+ <set>
+ <parameter name='gc.configuration-id'
+ value='`$generic-configuration-topology-operation-input.configuration-information.configuration-id`' />
+ <parameter name='gc.configuration-data.configuration-operation-information.sdnc-request-header.'
+ value='`$generic-configuration-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='gc.configuration-data.configuration-operation-information.request-information.'
+ value='`$generic-configuration-topology-operation-input.request-information.`' />
+ <parameter name='gc.configuration-data.configuration-operation-information.service-information.'
+ value='`$generic-configuration-topology-operation-input.service-information.`' />
+ <parameter name='gc.configuration-data.configuration-operation-information.configuration-information.'
+ value='`$generic-configuration-topology-operation-input.configuration-information.`' />
+ <parameter name='gc.configuration-data.configuration-operation-information.gc-request-input.'
+ value='`$generic-configuration-topology-operation-input.gc-request-input.`' />
+ </set>
+ <set>
+ <parameter name='gc.configuration-data.configuration-oper-status.order-status'
+ value='PendingCreate' />
+ <parameter name='gc.configuration-data.configuration-oper-status.last-rpc-action'
+ value='assign' />
+ <parameter name='gc.configuration-data.configuration-oper-status.last-action'
+ value='CreateGenericConfigurationInstance' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.gc-configuration`"/>
+ <parameter name="outputPath" value="tmp.gc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$gc.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.genconfig.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.gc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-gc" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Error updating md-sal for gc-configuration' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Error updating md-sal for gc-configuration' />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='notification-url'
+ value="`$prop.controller.url + '/restconf/operations/GENERIC-RESOURCE-API:generic-configuration-notification'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.bondingservice.server + $prop.bondingservice.uri`"/>
+ <parameter name="outputPath" value="tmp.bs-url"/>
+ <parameter name="target" value="{action}"/>
+ <parameter name="replacement" value="`$generic-configuration-topology-operation-input.sdnc-request-header.svc-action`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.bondingservice.templatefile`" />
+ <parameter name='restapiUrl' value='`$tmp.bs-url`' />
+ <parameter name='restapiUser' value='`$prop.bondingservice.user`' />
+ <parameter name='restapiPassword' value='`$prop.bondingservice.password`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name="responsePrefix" value="bonding-service-response" />
+ <parameter name='customHttpHeaders'
+ value="`'Authorization=Basic ' + $prop.bondingservice.authorization`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Error calling bonding service; ' + $error-message`" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='service-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $service-data.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-genconfig.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="`$bonding-service-response.ackFinalIndicator`" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="success" />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_get-complex-resource-service-model.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_get-complex-resource-service-model.xml
new file mode 100755
index 00000000..07a0486e
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_get-complex-resource-service-model.xml
@@ -0,0 +1,181 @@
+<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='get-complex-resource-service-model' mode='sync'>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from COMPLEX_RESOURCE
+ WHERE customization_uuid = $get-complex-resource-service-model-input.customization-uuid'
+ pfx='db.complex-resource'>
+ <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 complex resource found for customization UUID ' + $get-complex-resource-service-model-input.customization-uuid`" />
+ </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="`'No complex resource found for customization UUID ' + $get-complex-resource-service-model-input.customization-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from ATTRIBUTE_VALUE_PAIR
+ WHERE resource_uuid = $db.complex-resource.uuid
+ and resource_type = $db.complex-resource.type'
+ pfx='db.av-pair'>
+ <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 attribute found for customization UUID ' + $get-complex-resource-service-model-input.customization-uuid`" />
+ </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="`'No attribute found for customization UUID ' + $get-complex-resource-service-model-input.customization-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <for silentFailure='true' index='idx' start='0' end='`$db.av-pair_length`' >
+ <block atomic='true'>
+ <switch test="`$db.sdn-circuit-req[$idx].attribute-name == 'cr_function' `">
+ <outcome value='true'>
+ <set>
+ <parameter name='get-complex-resource-service-model-output.cr-function' value='`$db.sdn-circuit-req[$idx].attribute-value`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.sdn-circuit-req[$idx].attribute-name == 'cr_role'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.cr-role" value="`$db.sdn-circuit-req[$idx].attribute-value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.sdn-circuit-req[$idx].attribute-name == 'cr_type'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.cr-type" value="`$db.sdn-circuit-req[$idx].attribute-value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.sdn-circuit-req[$idx].attribute-name == 'network_collection_function'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.network-collection-function" value="`$db.sdn-circuit-req[$idx].attribute-value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.sdn-circuit-req[$idx].attribute-name == 'network_collection_description'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.network-collection-description" value="`$db.sdn-circuit-req[$idx].attribute-value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.sdn-circuit-req[$idx].attribute-name == 'subinterface_network_quantity'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.subinterface-network-quantity" value="`$db.sdn-circuit-req[$idx].attribute-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from NETWORK_MODEL
+ WHERE complex_resource_uuid = $db.complex-resource.uuid'
+ pfx='db.network-model'>
+ <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 network model found" />
+ </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="No network model found" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from RESOURCE_POLICY_TO_TARGET_NODE_MAPPING
+ WHERE target_node_uuid = $db.network-model.uuid
+ AND target_node_customization_uuid = db.network-model.customization-uuid'
+ pfx='db.respoltargetnodemap' >
+ <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 resource_policy_to_target_node_mapping found" />
+ </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="No resource_policy_to_target_node_mapping found" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="SELECT * from RESOURCE_POLICY
+ WHERE policy_uuid = $db.respoltargetnodemap.policy_uuid
+ and policy_type = 'ecomp.policies.External' "
+ pfx='db.resource-policy'>
+ <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 complex resource found for customization UUID ' + $get-complex-resource-service-model-input.customization-uuid`" />
+ </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="`'No complex resource found for customization UUID ' + $get-complex-resource-service-model-input.customization-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <for silentFailure='true' index='idx' start='0' end='`$db.resource-policy_length`' >
+ <block atomic='true'>
+ <switch test="`$db.resource-policy[$idx].property-type == 'Name' and $db.resource-policy[$idx].property-name == 'Network Collection Name'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.network-naming-policy" value="`$db.resource-policy[$idx].policy-name`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.resource-policy[$idx].property-type == 'subnetwork assignments' and $db.resource-policy[$idx].property-name == 'subnet'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.subnet-assignment-policy" value="`$db.resource-policy[$idx].policy-name`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.resource-policy[$idx].property-type == 'network assignments' and $db.resource-policy[$idx].property-name == 'route target'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.vpn-binding-policy" value="`$db.resource-policy[$idx].policy-name`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </get-resource>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_get-data-from-policy.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_get-data-from-policy.xml
new file mode 100755
index 00000000..2c825d6f
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_get-data-from-policy.xml
@@ -0,0 +1,204 @@
+<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='get-data-from-policy' mode='sync'>
+ <block atomic='true'>
+ <block atomic='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ <outcome value='success'>
+ <block atomic='true'>
+ <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="LAINA: get-data-from-policy: read properties file."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <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="LAINA: get-data-from-policy: Could not read properties file."/>
+ <parameter name="field3" value='`$prop.restapi.pm.getpolicy.templatefile`'/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='501' />
+ <parameter name='error-message' value='get-data-from-policy: could not read generic-resource-api properties' />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <switch test='`$get-data-from-policy-input.policy-instance-name`'>
+ <outcome value=''>
+ <block>
+ <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="LAINA: get-data-from-policy: input.policy-instance-name is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='507' />
+ <parameter name='error-message' value='get-data-from-policy: input.policy-instance-name is not set' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.policy-name' value="`$get-data-from-policy-input.policy-instance-name`" />
+ </set>
+ <record plugin="com.att.sdnctl.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: get-data-from-policy: restapi-call-node Call Policy Manager getPolicy"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.getpolicy.templatefile`" />
+ <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/getConfig'`" />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name='customHttpHeaders'
+ value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" />
+ <parameter name="responsePrefix" value="tmp.pm-response" />
+ <outcome value='failure'>
+ <block>
+ <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="LAINA: get-data-from-policy: Error calling Policy Manager getPolicy"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='502' />
+ <parameter name='error-message' value='get-data-from-policy: getPolicy call to Policy Manger failed' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <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="LAINA: get-data-from-policy: getPolicy SUCCESS"/>
+ <parameter name='field3' value='`$tmp.pm-response.type`' />
+ <parameter name='field4' value='`$tmp.pm-response.matchingConditions`' />
+ <parameter name='field5' value='`$tmp.pm-response.config`' />
+ <parameter name='field6' value='`$tmp.pm-response.response-code`' />
+ <parameter name='field7' value='`$tmp.pm-response.response-message`' />
+ </record>
+ <set>
+ <parameter name='policy-config' value="`$tmp.pm-response.config`" />
+ </set>
+ <switch test='`$tmp.pm-response.response-code`'>
+ <outcome value='500'>
+ <block>
+ <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="LAINA: get-data-from-policy: Error calling Policy Manager getPolicy"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='502' />
+ <parameter name='error-message' value='get-data-from-policy: getPolicy call to Policy Manger failed' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </execute>
+ <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="LAINA: get-data-from-policy: call jsonStringToCtx"/>
+ <parameter name='field3' value='`$policy-config`' />
+ </record>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="policy-config" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="true" />
+ <outcome value='failure'>
+ <block>
+ <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="LAINA: get-data-from-policy: Error calling jsonStringToCtx"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='504' />
+ <parameter name='error-message' value='get-data-from-policy: failed to parse Policy Manger getPolicy response' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <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="LAINA: get-data-from-policy: jsonStringToCtx SUCCESS: policyName|policy-data|"/>
+ <parameter name='field3' value='`$jsonContextPrefix.policyName`' />
+ <parameter name='field4' value='`$jsonContextPrefix.content.policy-data`' />
+ </record>
+ <switch test='`$jsonContextPrefix.content.policy-data_length > 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <for index='policyDataIndex' start='0' end='`$jsonContextPrefix.content.policy-data_length`' >
+ <set>
+ <parameter name="`'get-data-from-policy-output[' + $policyDataIndex + ']'`." value= '`$jsonContextPrefix.content.policy-data[$policyDataIndex].`' />
+ </set>
+ <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="LAINA: get-data-from-policy: policyDataIndex|nf-role|rule-1|rule-2:"/>
+ <parameter name='field3' value='`$policyDataIndex`' />
+ <parameter name='field4' value='`$jsonContextPrefix.content.policy-data[$policyDataIndex].nf-role`' />
+ <parameter name='field5' value='`$jsonContextPrefix.content.policy-data[$policyDataIndex].rule-1`' />
+ <parameter name='field6' value='`$jsonContextPrefix.content.policy-data[$policyDataIndex].rule-2`' />
+ </record>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$jsonContextPrefix.content.policy-data.extended-params_length > 0`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <for index='policyDataExtendedParamsIndex' start='0' end='`$jsonContextPrefix.content.policy-data.extended-params_length`' >
+ <set>
+ <parameter name='output-param-name' value='`$jsonContextPrefix.content.policy-data.extended-params[$policyDataExtendedParamsIndex].param-name`' />
+ <parameter name='output-param-value' value='`$jsonContextPrefix.content.policy-data.extended-params[$policyDataExtendedParamsIndex].param-value`' />
+ </set>
+ <set>
+ <parameter name="`'get-data-from-policy-output.' + $output-param-name`" value="`$output-param-value`" />
+ </set>
+ <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="LAINA: get-data-from-policy: policyDataExtendedParamsIndex|output-param-name|output-param-value:"/>
+ <parameter name='field3' value='`$policyDataExtendedParamsIndex`' />
+ <parameter name='field4' value='`$output-param-name`' />
+ <parameter name='field5' value='`$output-param-value`' />
+ </record>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='get-data-from-policy-output.' value='`$jsonContextPrefix.content.policy-data.`' />
+ </set>
+ <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="LAINA: get-data-from-policy: get-data-from-policy-output.:"/>
+ <parameter name='field3' value='`$get-data-from-policy-output.`' />
+ </record>
+ </block>
+ </outcome>
+ </execute>
+ <return status='success'></return>
+ </block>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-composite-match-pair.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-composite-match-pair.xml
new file mode 100755
index 00000000..0fb35dea
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-composite-match-pair.xml
@@ -0,0 +1,1912 @@
+<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='getpathsegment-composite-match-pair' mode='sync'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/gpsc.log' />
+ </execute>
+ <for index='left-node-index' start='0' end='`$serv-cust_length - 1`' >
+ <block>
+ <set>
+ <parameter name='right-node-index' value='`$left-node-index + 1`' />
+ </set>
+ <for silentFailure='true' index='left-serv-index' start='0' end='`$serv-cust[$left-node-index].serv-insts_length`' >
+ <block>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length' value='0' />
+ </set>
+ <for silentFailure='true' index='right-serv-index' start='0' end='`$serv-cust[$right-node-index].serv-insts_length`' >
+ <block>
+ <switch test='`$match-type`'>
+ <outcome value='network-name'>
+ <block>
+ <set>
+ <parameter name='found-match' value='false' />
+ </set>
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path_length`'>
+ <outcome value=''>
+ <switch test='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='0' />
+ <parameter name='left-vnf-index' value='0' />
+ <parameter name='right-vnf-index' value='0' />
+ </set>
+ <for silentFailure='true' index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <switch test="`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == 'oam'`">
+ <outcome value='false'>
+ <for silentFailure='true' index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='0' />
+ <parameter name='left-vnf-index' value='0' />
+ <parameter name='right-vnf-index' value='0' />
+ </set>
+ <for silentFailure='true' index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <switch test="`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == 'oam'`">
+ <outcome value='false'>
+ <for silentFailure='true' index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <for index='right-fp-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path_length`' >
+ <for index='right-sp-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path_length`' >
+ <block>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf_length`' >
+ <switch test='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf[$right-vnf-index].vnf-path-sequence-id
+ == 1`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf[$right-vnf-index].vnf-instance-id`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list_length`' >
+ <block>
+ <switch test='`$right-vnf-instance-id
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <for index='left-vnf-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list_length`' >
+ <block>
+ <for index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <block>
+ <for silentFailure='true' index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$right-vnf-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$right-node-index].serv-insts[$right-serv-index].rhs_vnf.'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </for>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='0'>
+ <switch test='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='0' />
+ <parameter name='left-vnf-index' value='0' />
+ <parameter name='right-vnf-index' value='0' />
+ </set>
+ <for silentFailure='true' index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <switch test="`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == 'oam'`">
+ <outcome value='false'>
+ <for silentFailure='true' index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='0' />
+ <parameter name='left-vnf-index' value='0' />
+ <parameter name='right-vnf-index' value='0' />
+ </set>
+ <for silentFailure='true' index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <switch test="`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == 'oam'`">
+ <outcome value='false'>
+ <for silentFailure='true' index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <for index='right-fp-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path_length`' >
+ <for index='right-sp-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path_length`' >
+ <block>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf_length`' >
+ <switch test='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf[$right-vnf-index].vnf-path-sequence-id
+ == 1`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf[$right-vnf-index].vnf-instance-id`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list_length`' >
+ <block>
+ <switch test='`$right-vnf-instance-id
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <for index='left-vnf-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list_length`' >
+ <block>
+ <for index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <block>
+ <for silentFailure='true' index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$right-vnf-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$right-node-index].serv-insts[$right-serv-index].rhs_vnf.'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </for>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path_length`'>
+ <outcome value=''>
+ <for index='left-fp-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path_length`' >
+ <for index='left-sp-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path_length`' >
+ <block>
+ <set>
+ <parameter name='max-seq' value='-1' />
+ </set>
+ <for index='left-vnf-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf[$left-vnf-index].vnf-path-sequence-id
+ &gt; $max-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='max-seq'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf[$left-vnf-index].vnf-path-sequence-id`' />
+ <parameter name='left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf[$left-vnf-index].vnf-instance-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <for index='left-vnf-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list_length`' >
+ <block>
+ <switch test='`$left-vnf-instance-id
+ == $serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list_length`' >
+ <block>
+ <for index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <for silentFailure='true' index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$left-vnf-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].lhs_vnf.'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </for>
+ </outcome>
+ <outcome value='0'>
+ <for index='left-fp-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path_length`' >
+ <for index='left-sp-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path_length`' >
+ <block>
+ <set>
+ <parameter name='max-seq' value='-1' />
+ </set>
+ <for index='left-vnf-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf[$left-vnf-index].vnf-path-sequence-id
+ &gt; $max-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='max-seq'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf[$left-vnf-index].vnf-path-sequence-id`' />
+ <parameter name='left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf[$left-vnf-index].vnf-instance-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <for index='left-vnf-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list_length`' >
+ <block>
+ <switch test='`$left-vnf-instance-id
+ == $serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list_length`' >
+ <block>
+ <for index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <for silentFailure='true' index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$left-vnf-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].lhs_vnf.'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </for>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for index='left-fp-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path_length`' >
+ <for index='left-sp-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path_length`' >
+ <block>
+ <set>
+ <parameter name='max-seq' value='-1' />
+ </set>
+ <for index='left-vnf-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf[$left-vnf-index].vnf-path-sequence-id
+ &gt; $max-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='max-seq'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf[$left-vnf-index].vnf-path-sequence-id`' />
+ <parameter name='left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.vnf[$left-vnf-index].vnf-instance-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <for index='left-vnf-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list_length`' >
+ <block>
+ <switch test='`$left-vnf-instance-id
+ == $serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <for index='right-fp-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path_length`' >
+ <for index='right-sp-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path_length`' >
+ <switch test='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].leftmost-vnf-index`'>
+ <outcome value=''>
+ <block>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf_length`' >
+ <switch test='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf[$right-vnf-index].vnf-path-sequence-id
+ == 1`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf[$right-vnf-index].vnf-instance-id`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list_length`' >
+ <block>
+ <switch test='`$right-vnf-instance-id
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].leftmost-vnf-index'
+ value='`$right-vnf-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='right-vnf-index'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].leftmost-vnf-index`' />
+ </set>
+ <for index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <for silentFailure='true' index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].lhs_vnf.'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$right-node-index].serv-insts[$right-serv-index].rhs_vnf.'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf_length`' >
+ <switch test='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf[$right-vnf-index].vnf-path-sequence-id
+ == 1`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.vnf[$right-vnf-index].vnf-instance-id`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for index='right-vnf-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list_length`' >
+ <block>
+ <switch test='`$right-vnf-instance-id
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].leftmost-vnf-index'
+ value='`$right-vnf-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='right-vnf-index'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].leftmost-vnf-index`' />
+ </set>
+ <for index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <for silentFailure='true' index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].lhs_vnf.'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$right-node-index].serv-insts[$right-serv-index].rhs_vnf.'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='right-vnf-index'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].leftmost-vnf-index`' />
+ </set>
+ <for index='left-vnf-network-index' start='0' end='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <for silentFailure='true' index='right-vnf-network-index' start='0' end='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].service-instance-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-name'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments[$ps-index].network-role'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].lhs_vnf.'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].forwarding-paths.forwarding-path[$left-fp-index].service-paths.service-path[$left-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$right-node-index].serv-insts[$right-serv-index].rhs_vnf.'
+ value='`$serv-cust[$right-node-index].serv-insts[$right-serv-index].forwarding-paths.forwarding-path[$right-fp-index].service-paths.service-path[$right-sp-index].service[0].vnfs.`' />
+ <parameter name='serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length'
+ value='`$serv-cust[$left-node-index].serv-insts[$left-serv-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$found-match`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/gpsd.log' />
+ </execute>
+ <set>
+ <parameter name='path-index' value='0' />
+ </set>
+ <for silentFailure='true' index='first-serv-index' start='0' end='`$serv-cust[0].serv-insts_length`' >
+ <switch test='`$serv-cust[0].serv-insts[$first-serv-index].path-segments_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='cur-vnf-seq' value='1' />
+ </set>
+ <set>
+ <parameter name='end-to-end-path' value='false' />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.service-path-instance-id" />
+ </execute>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service-path-instance-id' value='`$tmp.service-path-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service-path-instance-name'
+ value='`$db.path-segment[0].path-name + $tmp.service-path-instance-id`' />
+ </set>
+ <switch test='`$serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length' value='1' />
+ <parameter name='service-paths.service-path[$path-index].service[0].service-instance-id'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].service-path-sequence-id'
+ value='1' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].right-network-name'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].right-network-role'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].vf-module-instance.vf-module-id'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].left-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='cur-vnf-seq' value='`$cur-vnf-seq + 1`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length' value='1' />
+ <parameter name='service-paths.service-path[$path-index].service[0].service-instance-id'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].service-path-sequence-id'
+ value='1' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].right-network-name'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].right-network-role'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[0].vf-module-instance.vf-module-id'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].left-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='cur-vnf-seq' value='`$cur-vnf-seq + 1`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='max-vnf-seq' value='-1' />
+ <parameter name='max-vnf-idx' value='-1' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length' value='1' />
+ <parameter name='service-paths.service-path[$path-index].service[0].service-instance-id'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].service-path-sequence-id'
+ value='1' />
+ </set>
+ <for index='idx' start='0' end='`$serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-seq'
+ value='`$cur-vnf-seq + $serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf[$idx].vnf-path-sequence-id - 1`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[$idx].vnf-instance-id'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf[$idx].vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[$idx].vnf-path-sequence-id'
+ value='`$vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[$idx].left-network-name'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf[$idx].left-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[$idx].left-network-role'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf[$idx].left-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[$idx].right-network-name'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf[$idx].right-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[$idx].right-network-role'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf[$idx].right-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[$idx].vf-module-instance.vf-module-id'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf[$idx].vf-module-instance.vf-module-id`' />
+ </set>
+ <switch test='`$service-paths.service-path[$path-index].service[0].vnfs.vnf[$idx].vnf-path-sequence-id
+ &gt; $max-vnf-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='max-vnf-seq' value='`$service-paths.service-path[$path-index].service[0].vnfs.vnf[$idx].vnf-path-sequence-id`' />
+ <parameter name='max-vnf-idx' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='cur-vnf-seq'
+ value='`$cur-vnf-seq + $serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf_length`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[$max-vnf-idx].right-network-name'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf[$max-vnf-idx].right-network-role'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].network-role`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[0].vnfs.vnf_length'
+ value='`$serv-cust[0].serv-insts[$first-serv-index].lhs_vnf.vnf_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='next-service-instance-id' value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].right-service-instance-id`' />
+ <parameter name='prev-network-name' value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].network-name`' />
+ <parameter name='prev-network-role' value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].network-role`' />
+ <parameter name='next-vnf-instance-id' value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].right-vnf-instance-id`' />
+ <parameter name='next-vf-module-id' value='`$serv-cust[0].serv-insts[$first-serv-index].path-segments[0].right-vf-module-id`' />
+ </set>
+ <for index='node-index' start='1' end='`$serv-cust_length`' >
+ <block>
+ <set>
+ <parameter name='found-match' value='false' />
+ </set>
+ <for index='serv-index' start='0' end='`$serv-cust[$node-index].serv-insts_length`' >
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments_length`'>
+ <outcome value=''>
+ <switch test='`$node-index == $serv-cust_length - 1`'>
+ <outcome value='false'>
+ <block></block>
+ </outcome>
+ <outcome value='true'>
+ <block>
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id
+ == $next-service-instance-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <switch test='`$node-index == $serv-cust_length - 1`'>
+ <outcome value='true'>
+ <block>
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$next-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$next-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$next-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$next-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='min-vnf-seq' value='99' />
+ <parameter name='min-vnf-idx' value='99' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ </set>
+ <for index='idx' start='0' end='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-seq'
+ value='`$cur-vnf-seq + $serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].vnf-path-sequence-id - 1`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id'
+ value='`$vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].left-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].left-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].right-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].right-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vf-module-instance.vf-module-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].vf-module-instance.vf-module-id`' />
+ </set>
+ <switch test='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id
+ &lt; $min-vnf-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='min-vnf-seq' value='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id`' />
+ <parameter name='min-vnf-idx' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$min-vnf-idx].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$min-vnf-idx].left-network-role'
+ value='`$prev-network-role`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='end-to-end-path' value='true' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='max-vnf-seq' value='`$cur-vnf-seq`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='max-vnf-seq' value='`$cur-vnf-seq`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='max-vnf-seq' value='-1' />
+ <parameter name='max-vnf-idx' value='-1' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ </set>
+ <for index='idx' start='0' end='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-seq'
+ value='`$cur-vnf-seq + $serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].vnf-path-sequence-id - 1`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id'
+ value='`$vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].left-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].left-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].right-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].right-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vf-module-instance.vf-module-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].vf-module-instance.vf-module-id`' />
+ </set>
+ <switch test='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id
+ &gt; $max-vnf-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='max-vnf-seq' value='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id`' />
+ <parameter name='max-vnf-idx' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$max-vnf-idx].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$max-vnf-idx].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='0'>
+ <switch test='`$node-index == $serv-cust_length - 1`'>
+ <outcome value='false'>
+ <block></block>
+ </outcome>
+ <outcome value='true'>
+ <block>
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id
+ == $next-service-instance-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <switch test='`$node-index == $serv-cust_length - 1`'>
+ <outcome value='true'>
+ <block>
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$next-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$next-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$next-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$next-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='min-vnf-seq' value='99' />
+ <parameter name='min-vnf-idx' value='99' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ </set>
+ <for index='idx' start='0' end='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-seq'
+ value='`$cur-vnf-seq + $serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].vnf-path-sequence-id - 1`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id'
+ value='`$vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].left-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].left-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].right-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].right-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vf-module-instance.vf-module-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].vf-module-instance.vf-module-id`' />
+ </set>
+ <switch test='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id
+ &lt; $min-vnf-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='min-vnf-seq' value='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id`' />
+ <parameter name='min-vnf-idx' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$min-vnf-idx].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$min-vnf-idx].left-network-role'
+ value='`$prev-network-role`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='end-to-end-path' value='true' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='max-vnf-seq' value='`$cur-vnf-seq`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='max-vnf-seq' value='`$cur-vnf-seq`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='max-vnf-seq' value='-1' />
+ <parameter name='max-vnf-idx' value='-1' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ </set>
+ <for index='idx' start='0' end='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-seq'
+ value='`$cur-vnf-seq + $serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].vnf-path-sequence-id - 1`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id'
+ value='`$vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].left-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].left-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].right-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].right-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vf-module-instance.vf-module-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].vf-module-instance.vf-module-id`' />
+ </set>
+ <switch test='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id
+ &gt; $max-vnf-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='max-vnf-seq' value='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id`' />
+ <parameter name='max-vnf-idx' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$max-vnf-idx].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$max-vnf-idx].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id
+ == $next-service-instance-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <switch test='`$node-index == $serv-cust_length - 1`'>
+ <outcome value='true'>
+ <block>
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$next-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$next-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$next-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$next-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='min-vnf-seq' value='99' />
+ <parameter name='min-vnf-idx' value='99' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ </set>
+ <for index='idx' start='0' end='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-seq'
+ value='`$cur-vnf-seq + $serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].vnf-path-sequence-id - 1`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id'
+ value='`$vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].left-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].left-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].right-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].right-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vf-module-instance.vf-module-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf[$idx].vf-module-instance.vf-module-id`' />
+ </set>
+ <switch test='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id
+ &lt; $min-vnf-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='min-vnf-seq' value='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id`' />
+ <parameter name='min-vnf-idx' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$min-vnf-idx].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$min-vnf-idx].left-network-role'
+ value='`$prev-network-role`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='end-to-end-path' value='true' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$serv-cust[$node-index].serv-insts[$serv-index].rhs_vnf.vnf_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='max-vnf-seq' value='`$cur-vnf-seq`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vnf-path-sequence-id'
+ value='`$cur-vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[0].vf-module-instance'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].left-vf-module-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='max-vnf-seq' value='`$cur-vnf-seq`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='max-vnf-seq' value='-1' />
+ <parameter name='max-vnf-idx' value='-1' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service_length'
+ value='`$service-paths.service-path[$path-index].service_length + 1`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].service-path-sequence-id'
+ value='`$node-index + 1`' />
+ </set>
+ <for index='idx' start='0' end='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-seq'
+ value='`$cur-vnf-seq + $serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].vnf-path-sequence-id - 1`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-instance-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].vnf-instance-id`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id'
+ value='`$vnf-seq`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].left-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].left-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].left-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].right-network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].right-network-role`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vf-module-instance.vf-module-id'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf[$idx].vf-module-instance.vf-module-id`' />
+ </set>
+ <switch test='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id
+ &gt; $max-vnf-seq`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='max-vnf-seq' value='`$service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$idx].vnf-path-sequence-id`' />
+ <parameter name='max-vnf-idx' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$max-vnf-idx].right-network-name'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf[$max-vnf-idx].right-network-role'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ </set>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service[$node-index].vnfs.vnf_length'
+ value='`$serv-cust[$node-index].serv-insts[$serv-index].lhs_vnf.vnf_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-match`'>
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='service-paths.service-path[$path-index].service-path-instance-id' value='' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='next-service-instance-id' value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].right-service-instance-id`' />
+ <parameter name='prev-network-name' value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='prev-network-role' value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].network-role`' />
+ <parameter name='next-vnf-instance-id' value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].right-vnf-instance-id`' />
+ <parameter name='next-vf-module-id' value='`$serv-cust[$node-index].serv-insts[$serv-index].path-segments[0].right-vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='cur-vnf-seq' value='`$max-vnf-seq + 1`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='path-index' value='`$path-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='service-paths.service-path_length' value='`$path-index`' />
+ </set>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-create-composite-path.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-create-composite-path.xml
new file mode 100755
index 00000000..a09b03cb
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-create-composite-path.xml
@@ -0,0 +1,627 @@
+<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='getpathsegment-create-composite-path' mode='sync'>
+ <block>
+ <set>
+ <parameter name='match-type' value='network-name' />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from PATH_SEGMENT WHERE service_uuid = $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid
+ AND path_name = $db.forwarding-path[$path-index].path-name ORDER BY path_segment_seq'
+ pfx='db.path-segment[]'>
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='error-message' value="`'System error reading PATH_SEGMENT table for uuid '
+ + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid
+ + ' and path '
+ + $db.forwarding-path[$path-index].path-name`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='error-message' value="`'No entries in PATH_SEGMENT table for uuid '
+ + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid
+ + ' and path '
+ + $db.forwarding-path[$path-index].path-name`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='serv-cust_length' value='0' />
+ </set>
+ <for index='path-segment-index' start='0' end='`$db.path-segment_length`' >
+ <block>
+ <set>
+ <parameter name='serv-cust[$serv-cust_length].id' value='`$db.path-segment[$path-segment-index].source-association-uuid`' />
+ <parameter name='serv-cust_length' value='`$serv-cust_length + 1`' />
+ </set>
+ <switch test='`$path-segment-index == ( $db.path-segment_length - 1) `'>
+ <outcome value='true'>
+ <set>
+ <parameter name='serv-cust[$serv-cust_length].id' value='`$db.path-segment[$path-segment-index].target-association-uuid`' />
+ <parameter name='serv-cust_length' value='`$serv-cust_length + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <for index='serv-index' start='0' end='`$serv-cust_length`' >
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='select sm.invariant_uuid
+ from SERVICE_PROXY sp, SERVICE_MODEL sm
+ where sp.parent_service_uuid = sm.service_uuid
+ and sp.customization_uuid = $serv-cust[$serv-index].id'
+ pfx='db'>
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`'Failure reading SERVICE_PROXY and SERVICE_MODEL for customization uuid ' + $serv-cust[$serv-index].id`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`'Cannot find entries in SERVICE_PROXY and SERVICE_MODEL for customization uuid ' + $serv-cust[$serv-index].id`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='serv-cust[$serv-index].inv-id' value='`$db.invariant-uuid`' />
+ </set>
+ </outcome>
+ </get-resource>
+ </for>
+ <for index='serv-index' start='0' end='`$serv-cust_length`' >
+ <switch test='`$serv-cust[$serv-index].inv-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="aai.service-instances" >
+ <parameter name="start[0]" value="`'nodes/service-instances?model-invariant-id=' + $serv-cust[$serv-index].inv-id`" />
+ <parameter name="start_length" value="1" />
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="`'Unable to find runtime service instances for invariant UUID ' + $serv-cust[$serv-index].inv-id`" />
+ </set>
+ </outcome>
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="`'System error finding runtime service instances for customization UUID ' + $serv-cust[$serv-index].inv-id`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='tmp.serv-insts_length' value='0' />
+ </set>
+ <for index='runtime-index' start='0' end='`$aai.service-instances.results_length`' >
+ <switch test='`$aai.service-instances.results[$runtime-index].service-instance.orchestration-status`'>
+ <outcome value='Active'>
+ <block>
+ <set>
+ <parameter name='serv-inst.service-instance-id' value='`$aai.service-instances.results[$runtime-index].service-instance.service-instance-id`' />
+ </set>
+ <switch test='`$output-global-customer-id`'>
+ <outcome value=''>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource_and_url'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.si">
+ <parameter name="start[0]" value="`'nodes/service-instance/' + $serv-inst.service-instance-id `" />
+ <parameter name="start_length" value="1" />
+ <outcome value='success'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$tmp.AnAI-data.si.results[0].url`" />
+ <parameter name="regex" value="/"/>
+ <parameter name="limit" value="11" />
+ <parameter name="ctx_memory_result_key" value="split" />
+ </execute>
+ <set>
+ <parameter name='output-global-customer-id' value='`$split[6]`' />
+ <parameter name='output-service-type' value='`$split[9]`' />
+ <parameter name='output-service-role' value='`$tmp.AnAI-data.si.results[0].service-instance.service-role`' />
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <block>
+ <switch test='`$runtime-index`'>
+ <outcome value='0'>
+ <set>
+ <parameter name='service.service-role' value='`$aai.service-instances.results[0].service-instance.service-role`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='mdsal-service.' value='' />
+ <parameter name='serv-inst.api' value='' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.service`"/>
+ <parameter name="outputPath" value="tmp.service-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$serv-inst.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.service-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-service" />
+ <outcome value='success'>
+ <block>
+ <switch test='`$mdsal-service.service[0].service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='data-error' value="`'Service instance ' + $si.service-instance-id + ' has no VNFs, skipping'`" />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='data-error' value="`'Service instance ' + $si.service-instance-id + ' has no VNFs, skipping'`" />
+ </set>
+ </outcome>
+ <outcome value='1'>
+ <block>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-populate-from-grapi' mode='sync' ></call>
+ <set>
+ <parameter name='serv-cust[$serv-index].serv-insts[$tmp.serv-insts_length].' value='`$serv-inst.`' />
+ </set>
+ <set>
+ <parameter name='tmp.serv-insts_length' value='`$tmp.serv-insts_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$mdsal-service.service[0].service-data.forwarding-paths.forwarding-path_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='data-error' value="`'Service instance ' + $serv-inst.service-instance-id + ' has multiple VNFs but no forwarding paths were found'`" />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='data-error' value="`'Service instance ' + $serv-inst.service-instance-id + ' has multiple VNFs but no forwarding paths were found'`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-populate-from-grapi' mode='sync' ></call>
+ <set>
+ <parameter name='serv-cust[$serv-index].serv-insts[$tmp.serv-insts_length].' value='`$serv-inst.`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$serv-index].serv-insts[$tmp.serv-insts_length].forwarding-paths.'
+ value='`$mdsal-service.service[0].service-data.forwarding-paths.`' />
+ </set>
+ <set>
+ <parameter name='tmp.serv-insts_length' value='`$tmp.serv-insts_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-populate-from-vnfapi' mode='sync' ></call>
+ <switch test='`$serv-inst.api`'>
+ <outcome value=''>
+ <set>
+ <parameter name='data-error' value="`'Failure finding service instance ' + $si.service-instance-id + ' in either GENERIC-REOURCE-API or VNF-API'`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <switch test='`$serv-inst.vnf-list_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='data-error' value="`'Service instance ' + $si.service-instance-id + ' has no VNFs, skipping'`" />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='data-error' value="`'Service instance ' + $si.service-instance-id + ' has no VNFs, skipping'`" />
+ </set>
+ </outcome>
+ <outcome value='1'>
+ <block>
+ <set>
+ <parameter name='serv-cust[$serv-index].serv-insts[$tmp.serv-insts_length].' value='`$serv-inst.`' />
+ </set>
+ <set>
+ <parameter name='tmp.serv-insts_length' value='`$tmp.serv-insts_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT forwarding_path_service_instance_id from SERVICE_INSTANCE_TO_COMPOSITE_INSTANCE_MAPPING WHERE simple_service_instance_id = $serv-inst.service-instance-id'
+ pfx='db.mapped-service-instance-id'>
+ <outcome value='failure'>
+ <set>
+ <parameter name='data-error' value="System error reading SERVICE_INSTANCE_TO_COMPOSITE_INSTANCE_MAPPING table" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='data-error' value="`'No entry in SERVICE_INSTANCE_TO_COMPOSITE_INSTANCE_MAPPING table for service instance ' + $serv-inst.service-instance-id`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.service`"/>
+ <parameter name="outputPath" value="tmp.service-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$db.mapped-service-instance-id.forwarding-path-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.service-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-service" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='data-error' value="`'Cannot find service instance ' + $db.mapped-service-instance-id.forwarding-path-service-instance-id + ' in MD-SAL'`" />
+ </set>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$mdsal-service.service[0].service-data.forwarding-paths.forwarding-path_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='data-error' value="`'Service instance ' + $db.mapped-service-instance-id.forwarding-path-service-instance-id + ' has multiple VNFs but no forwarding paths were found'`" />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='data-error' value="`'Service instance ' + $db.mapped-service-instance-id.forwarding-path-service-instance-id + ' has multiple VNFs but no forwarding paths were found'`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='serv-cust[$serv-index].serv-insts[$tmp.serv-insts_length].' value='`$serv-inst.`' />
+ </set>
+ <set>
+ <parameter name='serv-cust[$serv-index].serv-insts[$tmp.serv-insts_length].forwarding-paths.'
+ value='`$mdsal-service.service[0].service-data.forwarding-paths.`' />
+ </set>
+ <set>
+ <parameter name='tmp.serv-insts_length' value='`$tmp.serv-insts_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='serv-inst.' value='' />
+ </set>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='serv-cust[$serv-index].serv-insts_length' value='`$tmp.serv-insts_length`' />
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ </for>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-composite-match-pair' mode='sync' ></call>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/gpsx.log' />
+ </execute>
+ <switch test='`$service-paths.service-path_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='found-service-path' value='false' />
+ </set>
+ <for index='sp-index' start='0' end='`$service-paths.service-path_length`' >
+ <switch test='`$service-paths.service-path[$sp-index].service_length == $serv-cust_length`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-service-path' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-service-path`'>
+ <outcome value='false'>
+ <set>
+ <parameter name='error-message' value="`'No service paths found for path name '
+ + $db.path-segment[0].path-name`" />
+ </set>
+ </outcome>
+ <outcome value='true'>
+ <block>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="forwarding-path.forwarding-path-id" />
+ </execute>
+ <set>
+ <parameter name='forwarding-path.forwarding-path-name' value='`$db.path-segment[0].path-name`' />
+ <parameter name='forwarding-path.forwarding-path-type' value='Service' />
+ <parameter name='forwarding-path.onap-model-information.model-name' value='`$db.path-segment[0].path-name`' />
+ </set>
+ <set>
+ <parameter name='forwarding-path.service-paths.' value='`$service-paths.`' />
+ </set>
+ <switch test='`$output-service-instance-id`'>
+ <outcome value=''>
+ <block>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.service-instance-id" />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.service`"/>
+ <parameter name="outputPath" value="tmp.service-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.csm.serviceinstance.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.service-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-sr" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in MD-SAL" />
+ </set>
+ </outcome>
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $output-global-customer-id
+ AND service-subscription.service-type = $output-service-type
+ AND service-instance.service-instance-id = $tmp.service-instance-id" >
+ <parameter name="service-instance-id" value="`$tmp.service-instance-id`" />
+ <parameter name="global-customer-id" value="`$output-global-customer-id`" />
+ <parameter name="service-type" value="`$output-service-type`" />
+ <parameter name="service-role" value="`$output-service-role`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in AAI" />
+ </set>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='output-service-instance-id' value='`$tmp.service-instance-id`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.service-instance-id" />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.service`"/>
+ <parameter name="outputPath" value="tmp.service-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.csm.serviceinstance.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.service-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-sr" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in MD-SAL" />
+ </set>
+ </outcome>
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $output-global-customer-id
+ AND service-subscription.service-type = $output-service-type
+ AND service-instance.service-instance-id = $tmp.service-instance-id" >
+ <parameter name="service-instance-id" value="`$tmp.service-instance-id`" />
+ <parameter name="global-customer-id" value="`$output-global-customer-id`" />
+ <parameter name="service-type" value="`$output-service-type`" />
+ <parameter name="service-role" value="`$output-service-role`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in AAI" />
+ </set>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='output-service-instance-id' value='`$tmp.service-instance-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.forwarding-path`"/>
+ <parameter name="outputPath" value="tmp.fp-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$output-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.forwardingpath.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.fp-url + $forwarding-path.forwarding-path-id`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-fp" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to MD-SAL" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to MD-SAL" />
+ </set>
+ </outcome>
+ </execute>
+ <for index='sp-index' start='0' end='`$service-paths.service-path_length`' >
+ <switch test='`$service-paths.service-path[$sp-index].service_length == $serv-cust_length`'>
+ <outcome value='true'>
+ <block>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarding-path"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[$sp-index].service-path-instance-id" >
+ <parameter name="forwarding-path-id" value="`$forwarding-path.service-paths.service-path[$sp-index].service-path-instance-id`" />
+ <parameter name="forwarding-path-name" value="`$forwarding-path.service-paths.service-path[$sp-index].service-path-instance-name`" />
+ <parameter name="selflink" value="`'/restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $output-service-instance-id
+ + '/forwarding-paths/forwarding-path/'
+ + $forwarding-path.forwarding-path-id
+ + '/services-paths/service-path/'
+ + $forwarding-path.service-paths.service-path[$sp-index].service-path-instance-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to AAI" />
+ </set>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarding-path:relationship-list"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[$sp-index].service-path-instance-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="service-instance" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/business/customers/customer/'
+ + $output-global-customer-id
+ + '/service-subscriptions/service-subscription/'
+ + $output-service-type
+ + '/service-instances/service-instance/'
+ + $output-service-instance-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path relationship to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path relationship to AAI" />
+ </set>
+ </outcome>
+ </save>
+ <for index='service-index' start='0' end='`$service-paths.service-path[$sp-index].service_length`' >
+ <for index='vnf-index' start='0' end='`$forwarding-path.service-paths.service-path[$sp-index].service[$service-index].vnfs.vnf_length`' >
+ <block>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarder"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[$sp-index].service-path-instance-id
+ AND forwarder.sequence = $forwarding-path.service-paths.service-path[$sp-index].service[$service-index].vnfs.vnf[$vnf-index].vnf-path-sequence-id" >
+ <parameter name="sequence" value="`$forwarding-path.service-paths.service-path[$sp-index].service[$service-index].vnfs.vnf[$vnf-index].vnf-path-sequence-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder to AAI" />
+ </set>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarder:relationship-list"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[$sp-index].service-path-instance-id
+ AND forwarder.sequence = $forwarding-path.service-paths.service-path[$sp-index].service[$service-index].vnfs.vnf[$vnf-index].vnf-path-sequence-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/generic-vnfs/generic-vnf/'
+ + $forwarding-path.service-paths.service-path[$sp-index].service[$service-index].vnfs.vnf[$vnf-index].vnf-instance-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder relationship to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder relationship to AAI" />
+ </set>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-create-simple-path.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-create-simple-path.xml
new file mode 100755
index 00000000..71d3c779
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-create-simple-path.xml
@@ -0,0 +1,749 @@
+<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='getpathsegment-create-simple-path' mode='sync'>
+ <block>
+ <set>
+ <parameter name='match-type' value='network-name' />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from PATH_SEGMENT WHERE service_uuid = $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid
+ AND path_name = $db.forwarding-path[$path-index].path-name ORDER BY path_segment_seq'
+ pfx='db.path-segment[]'>
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='error-message' value="`'System error reading PATH_SEGMENT table for uuid '
+ + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid
+ + ' and path '
+ + $db.forwarding-path[$path-index].path-name`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='error-message' value="`'No entries in PATH_SEGMENT table for uuid '
+ + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid
+ + ' and path '
+ + $db.forwarding-path[$path-index].path-name`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='vnf-ids_length' value='0' />
+ </set>
+ <for index='path-segment-index' start='0' end='`$db.path-segment_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-ids[$vnf-ids_length]' value='`$db.path-segment[$path-segment-index].source-association-uuid`' />
+ <parameter name='vnf-ids_length' value='`$vnf-ids_length + 1`' />
+ </set>
+ <switch test='`$path-segment-index == ( $db.path-segment_length - 1) `'>
+ <outcome value='true'>
+ <set>
+ <parameter name='vnf-ids[$vnf-ids_length]' value='`$db.path-segment[$path-segment-index].target-association-uuid`' />
+ <parameter name='vnf-ids_length' value='`$vnf-ids_length + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="aai.service-instances" >
+ <parameter name="start[0]" value="`'nodes/service-instances?model-invariant-id=' + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-invariant-uuid`" />
+ <parameter name="start_length" value="1" />
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='error-message' value="`'No run-time service instances in AAI for invariant uuid '
+ + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-invariant-uuid`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='error-message' value="`'System error calling AAI to get run-time service instances for invariant uuid '
+ + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-invariant-uuid`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='runtime_length' value='0' />
+ </set>
+ <for index='runtime-index' start='0' end='`$aai.service-instances.results_length`' >
+ <switch test='`$aai.service-instances.results[$runtime-index].service-instance.orchestration-status`'>
+ <outcome value='Active'>
+ <block>
+ <set>
+ <parameter name='runtime-ids[$runtime_length]' value='`$aai.service-instances.results[$runtime-index].service-instance.service-instance-id`' />
+ </set>
+ <set>
+ <parameter name='runtime_length' value='`$runtime_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='serv-insts_length' value='0' />
+ </set>
+ <for index='runtime-index' start='0' end='`$runtime_length`' >
+ <block>
+ <set>
+ <parameter name='serv-inst.service-instance-id' value='`$runtime-ids[$runtime-index]`' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource_and_url'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.si">
+ <parameter name="start[0]" value="`'nodes/service-instance/' + $serv-inst.service-instance-id `" />
+ <parameter name="start_length" value="1" />
+ <outcome value='success'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$tmp.AnAI-data.si.results[0].url`" />
+ <parameter name="regex" value="/"/>
+ <parameter name="limit" value="11" />
+ <parameter name="ctx_memory_result_key" value="split" />
+ </execute>
+ <set>
+ <parameter name='output-global-customer-id' value='`$split[6]`' />
+ <parameter name='output-service-type' value='`$split[9]`' />
+ <parameter name='output-service-role' value='`$tmp.AnAI-data.si.results[0].service-instance.service-role`' />
+ </set>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='mdsal-service.' value='' />
+ <parameter name='serv-inst.api' value='' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.service`"/>
+ <parameter name="outputPath" value="tmp.service-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$serv-inst.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.service-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-service" />
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='found-path' value='false' />
+ </set>
+ <for silentFailure='true' index='fp-index' start='0' end='`$mdsal-service.service[0].service-data.forwarding-paths.forwarding-path_length`' >
+ <switch test='`$mdsal-service.service[0].service-data.forwarding-paths.forwarding-path[$fp-index].forwarding-path-name
+ == $db.path-segment[0].path-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-path' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-path`'>
+ <outcome value='false'>
+ <block>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-populate-from-grapi' mode='sync' ></call>
+ <set>
+ <parameter name='serv-insts[$serv-insts_length].' value='`$serv-inst.`' />
+ </set>
+ <set>
+ <parameter name='serv-insts_length' value='`$serv-insts_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='select forwarding_path_service_instance_id
+ from SERVICE_INSTANCE_TO_COMPOSITE_INSTANCE_MAPPING
+ where simple_service_instance_id = $serv-inst.service-instance-id'
+ pfx='db.sitcim'>
+ <outcome value='not-found'>
+ <block>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-populate-from-vnfapi' mode='sync' ></call>
+ <switch test='`$serv-inst.api`'>
+ <outcome value=''>
+ <set>
+ <parameter name='error-message' value="`'Failure finding service instance ' + $serv-inst.service-instance-id + ' in either GENERIC-REOURCE-API or VNF-API'`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='serv-insts[$serv-insts_length].' value='`$serv-inst.`' />
+ </set>
+ <set>
+ <parameter name='serv-insts_length' value='`$serv-insts_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </for>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-simple-match-pair' mode='sync' ></call>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/gps.log' />
+ </execute>
+ <for index='serv-index' start='0' end='`$serv-insts_length`' >
+ <switch test='`$serv-insts[$serv-index].api`'>
+ <outcome value='GR'>
+ <switch test='`$serv-insts[$serv-index].path-segments_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="forwarding-path.forwarding-path-id" />
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="forwarding-path.service-paths.service-path[0].service-path-instance-id" />
+ </execute>
+ <set>
+ <parameter name='forwarding-path.forwarding-path-name' value='`$db.path-segment[0].path-name`' />
+ <parameter name='forwarding-path.forwarding-path-type' value='VNF' />
+ <parameter name='forwarding-path.onap-model-information.model-name' value='`$db.path-segment[0].path-name`' />
+ <parameter name='forwarding-path.service-paths.service-path_length' value='1' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service-path-instance-name'
+ value='`$db.path-segment[0].path-name + $forwarding-path.service-paths.service-path[0].service-path-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service_length' value='1' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].service-instance-id'
+ value='`$serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].service-path-sequence-id' value='1' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf_length'
+ value='`$serv-insts[$serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].vnf-path-sequence-id'
+ value='1' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-insts[$serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].right-network-name'
+ value='`$serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].right-network-role'
+ value='`$serv-insts[$serv-index].path-segments[0].network-role`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].vf-module-instance.vf-module-id'
+ value='`$serv-insts[$serv-index].path-segments[0].left-vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='prev-network-name' value='`$serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='prev-network-role' value='`$serv-insts[$serv-index].path-segments[0].network-role`' />
+ </set>
+ <for index='ps-index' start='1' end='`$serv-insts[$serv-index].path-segments_length`' >
+ <block>
+ <set>
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].vnf-path-sequence-id'
+ value='`$ps-index + 1`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].vnf-instance-id'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].left-vnf-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].right-network-name'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].network-name`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].right-network-role'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].network-role`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].vf-module-instance.vf-module-id'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].left-vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='prev-network-name' value='`$serv-insts[$serv-index].path-segments[$ps-index].network-name`' />
+ <parameter name='prev-network-role' value='`$serv-insts[$serv-index].path-segments[$ps-index].network-role`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].vnf-path-sequence-id'
+ value='`$ps-index + 2`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].vnf-instance-id'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].right-vnf-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].vf-module-instance.vf-module-id'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].right-vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf_length'
+ value='`$serv-insts[$serv-index].path-segments_length + 1`' />
+ </set>
+ <switch test='`$serv-insts[$serv-index].api`'>
+ <outcome value='GR'>
+ <set>
+ <parameter name='tmp.service-instance-id' value='`$serv-insts[$serv-index].service-instance-id`' />
+ </set>
+ </outcome>
+ <outcome value='VNF'>
+ <block>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.service-instance-id" />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.service`"/>
+ <parameter name="outputPath" value="tmp.service-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.csm.serviceinstance.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.service-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-sr" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in MD-SAL" />
+ </set>
+ </outcome>
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $output-global-customer-id
+ AND service-subscription.service-type = $output-service-type
+ AND service-instance.service-instance-id = $tmp.service-instance-id" >
+ <parameter name="service-instance-id" value="`$tmp.service-instance-id`" />
+ <parameter name="global-customer-id" value="`$output-global-customer-id`" />
+ <parameter name="service-type" value="`$output-service-type`" />
+ <parameter name="service-role" value="`$output-service-role`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in AAI" />
+ </set>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="INSERT INTO SERVICE_INSTANCE_TO_COMPOSITE_INSTANCE_MAPPING
+ (simple_service_instance_id, forwarding_path_service_instance_id)
+ VALUES ( $serv-insts[$serv-index].service-instance-id , $tmp.service-instance-id )" ></save>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.forwarding-path`"/>
+ <parameter name="outputPath" value="tmp.fp-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.forwardingpath.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.fp-url + $forwarding-path.forwarding-path-id`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-fp" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to MD-SAL" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to MD-SAL" />
+ </set>
+ </outcome>
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarding-path"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[0].service-path-instance-id" >
+ <parameter name="forwarding-path-id" value="`$forwarding-path.service-paths.service-path[0].service-path-instance-id`" />
+ <parameter name="forwarding-path-name" value="`$forwarding-path.service-paths.service-path[0].service-path-instance-name`" />
+ <parameter name="selflink" value="`'/restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $tmp.service-instance-id
+ + '/forwarding-paths/forwarding-path/'
+ + $forwarding-path.forwarding-path-id
+ + '/services-paths/service-path/'
+ + $forwarding-path.service-paths.service-path[0].service-path-instance-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to AAI" />
+ </set>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarding-path:relationship-list"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[0].service-path-instance-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="service-instance" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/business/customers/customer/'
+ + $output-global-customer-id
+ + '/service-subscriptions/service-subscription/'
+ + $output-service-type
+ + '/service-instances/service-instance/'
+ + $tmp.service-instance-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path relationship to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path relationship to AAI" />
+ </set>
+ </outcome>
+ </save>
+ <for index='vnf-index' start='0' end='`$forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf_length`' >
+ <block>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarder"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[0].service-path-instance-id AND forwarder.sequence = $forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$vnf-index].vnf-path-sequence-id" >
+ <parameter name="sequence" value="`$forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$vnf-index].vnf-path-sequence-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder to AAI" />
+ </set>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarder:relationship-list"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[0].service-path-instance-id
+ AND forwarder.sequence = $forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$vnf-index].vnf-path-sequence-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/generic-vnfs/generic-vnf/'
+ + $forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$vnf-index].vnf-instance-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder relationship to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder relationship to AAI" />
+ </set>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='VNF'>
+ <switch test='`$serv-insts[$serv-index].path-segments_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="forwarding-path.forwarding-path-id" />
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="forwarding-path.service-paths.service-path[0].service-path-instance-id" />
+ </execute>
+ <set>
+ <parameter name='forwarding-path.forwarding-path-name' value='`$db.path-segment[0].path-name`' />
+ <parameter name='forwarding-path.forwarding-path-type' value='VNF' />
+ <parameter name='forwarding-path.onap-model-information.model-name' value='`$db.path-segment[0].path-name`' />
+ <parameter name='forwarding-path.service-paths.service-path_length' value='1' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service-path-instance-name'
+ value='`$db.path-segment[0].path-name + $forwarding-path.service-paths.service-path[0].service-path-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service_length' value='1' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].service-instance-id'
+ value='`$serv-insts[$serv-index].service-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].service-path-sequence-id' value='1' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf_length'
+ value='`$serv-insts[$serv-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].vnf-path-sequence-id'
+ value='1' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].vnf-instance-id'
+ value='`$serv-insts[$serv-index].path-segments[0].left-vnf-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].right-network-name'
+ value='`$serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].right-network-role'
+ value='`$serv-insts[$serv-index].path-segments[0].network-role`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[0].vf-module-instance.vf-module-id'
+ value='`$serv-insts[$serv-index].path-segments[0].left-vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='prev-network-name' value='`$serv-insts[$serv-index].path-segments[0].network-name`' />
+ <parameter name='prev-network-role' value='`$serv-insts[$serv-index].path-segments[0].network-role`' />
+ </set>
+ <for index='ps-index' start='1' end='`$serv-insts[$serv-index].path-segments_length`' >
+ <block>
+ <set>
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].vnf-path-sequence-id'
+ value='`$ps-index + 1`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].vnf-instance-id'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].left-vnf-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].right-network-name'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].network-name`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].right-network-role'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].network-role`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index].vf-module-instance.vf-module-id'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].left-vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='prev-network-name' value='`$serv-insts[$serv-index].path-segments[$ps-index].network-name`' />
+ <parameter name='prev-network-role' value='`$serv-insts[$serv-index].path-segments[$ps-index].network-role`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].vnf-path-sequence-id'
+ value='`$ps-index + 2`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].vnf-instance-id'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].right-vnf-instance-id`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].left-network-name'
+ value='`$prev-network-name`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].left-network-role'
+ value='`$prev-network-role`' />
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$ps-index + 1].vf-module-instance.vf-module-id'
+ value='`$serv-insts[$serv-index].path-segments[$ps-index].right-vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf_length'
+ value='`$serv-insts[$serv-index].path-segments_length + 1`' />
+ </set>
+ <switch test='`$serv-insts[$serv-index].api`'>
+ <outcome value='GR'>
+ <set>
+ <parameter name='tmp.service-instance-id' value='`$serv-insts[$serv-index].service-instance-id`' />
+ </set>
+ </outcome>
+ <outcome value='VNF'>
+ <block>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.service-instance-id" />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.service`"/>
+ <parameter name="outputPath" value="tmp.service-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.csm.serviceinstance.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.service-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-sr" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in MD-SAL" />
+ </set>
+ </outcome>
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $output-global-customer-id
+ AND service-subscription.service-type = $output-service-type
+ AND service-instance.service-instance-id = $tmp.service-instance-id" >
+ <parameter name="service-instance-id" value="`$tmp.service-instance-id`" />
+ <parameter name="global-customer-id" value="`$output-global-customer-id`" />
+ <parameter name="service-type" value="`$output-service-type`" />
+ <parameter name="service-role" value="`$output-service-role`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure creating service instance in AAI" />
+ </set>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="INSERT INTO SERVICE_INSTANCE_TO_COMPOSITE_INSTANCE_MAPPING
+ (simple_service_instance_id, forwarding_path_service_instance_id)
+ VALUES ( $serv-insts[$serv-index].service-instance-id , $tmp.service-instance-id )" ></save>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.forwarding-path`"/>
+ <parameter name="outputPath" value="tmp.fp-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.forwardingpath.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.fp-url + $forwarding-path.forwarding-path-id`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-fp" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to MD-SAL" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to MD-SAL" />
+ </set>
+ </outcome>
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarding-path"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[0].service-path-instance-id" >
+ <parameter name="forwarding-path-id" value="`$forwarding-path.service-paths.service-path[0].service-path-instance-id`" />
+ <parameter name="forwarding-path-name" value="`$forwarding-path.service-paths.service-path[0].service-path-instance-name`" />
+ <parameter name="selflink" value="`'/restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $tmp.service-instance-id
+ + '/forwarding-paths/forwarding-path/'
+ + $forwarding-path.forwarding-path-id
+ + '/services-paths/service-path/'
+ + $forwarding-path.service-paths.service-path[0].service-path-instance-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path to AAI" />
+ </set>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarding-path:relationship-list"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[0].service-path-instance-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="service-instance" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/business/customers/customer/'
+ + $output-global-customer-id
+ + '/service-subscriptions/service-subscription/'
+ + $output-service-type
+ + '/service-instances/service-instance/'
+ + $tmp.service-instance-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path relationship to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarding-path relationship to AAI" />
+ </set>
+ </outcome>
+ </save>
+ <for index='vnf-index' start='0' end='`$forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf_length`' >
+ <block>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarder"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[0].service-path-instance-id AND forwarder.sequence = $forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$vnf-index].vnf-path-sequence-id" >
+ <parameter name="sequence" value="`$forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$vnf-index].vnf-path-sequence-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder to AAI" />
+ </set>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="forwarder:relationship-list"
+ key="forwarding-path.forwarding-path-id = $forwarding-path.service-paths.service-path[0].service-path-instance-id
+ AND forwarder.sequence = $forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$vnf-index].vnf-path-sequence-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/generic-vnfs/generic-vnf/'
+ + $forwarding-path.service-paths.service-path[0].service[0].vnfs.vnf[$vnf-index].vnf-instance-id`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder relationship to AAI" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='error-message' value="Failure writing forwarder relationship to AAI" />
+ </set>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </get-resource>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-populate-from-grapi.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-populate-from-grapi.xml
new file mode 100755
index 00000000..1ae609a0
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-populate-from-grapi.xml
@@ -0,0 +1,145 @@
+<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='getpathsegment-populate-from-grapi' mode='sync'>
+ <block>
+ <switch test='`$vnf-ids_length`'>
+ <outcome value=''>
+ <block>
+ <for silentFailure='true' index='vnf-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-network-list_length' value='0' />
+ </set>
+ <set>
+ <parameter name='vnf-ids-index' value='`$vnf-index`' />
+ </set>
+ <block>
+ <set>
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-id' value='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-id`' />
+ </set>
+ <for silentFailure='true' index='vnf-network-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <for silentFailure='true' index='vf-module-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <for silentFailure='true' index='vm-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vm-network-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-index].vm-networks.vm-network_length`' >
+ <switch test='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role
+ == $mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-index].vm-networks.vm-network[$vm-network-index].network-role`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-network-list[$vnf-network-list_length].network-name'
+ value='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-name`' />
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-network-list[$vnf-network-list_length].network-role'
+ value='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role`' />
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-network-list[$vnf-network-list_length].vf-module-id'
+ value='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='vnf-network-list_length' value='`$vnf-network-list_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </for>
+ </for>
+ <set>
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-network-list_length' value='`$vnf-network-list_length`' />
+ </set>
+ </block>
+ </block>
+ </for>
+ <set>
+ <parameter name='serv-inst.api' value='GR' />
+ </set>
+ <set>
+ <parameter name='serv-inst.vnf-list_length'
+ value='`$mdsal-service.service[0].service-data.vnfs.vnf_length`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='mismatch' value='false' />
+ </set>
+ <for silentFailure='true' index='vnf-ids-index' start='0' end='`$vnf-ids_length`' >
+ <block>
+ <set>
+ <parameter name='vnf-network-list_length' value='0' />
+ </set>
+ <for silentFailure='true' index='vnf-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf_length`' >
+ <switch test='`$vnf-ids[$vnf-ids-index] == $mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.onap-model-information.model-customization-uuid`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-id' value='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-id`' />
+ </set>
+ <for silentFailure='true' index='vnf-network-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <for silentFailure='true' index='vf-module-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <for silentFailure='true' index='vm-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vm-network-index' start='0' end='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-index].vm-networks.vm-network_length`' >
+ <switch test='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role
+ == $mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-index].vm-networks.vm-network[$vm-network-index].network-role`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-network-list[$vnf-network-list_length].network-name'
+ value='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-name`' />
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-network-list[$vnf-network-list_length].network-role'
+ value='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role`' />
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-network-list[$vnf-network-list_length].vf-module-id'
+ value='`$mdsal-service.service[0].service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`' />
+ </set>
+ <set>
+ <parameter name='vnf-network-list_length' value='`$vnf-network-list_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </for>
+ </for>
+ <set>
+ <parameter name='serv-inst.vnf-list[$vnf-ids-index].vnf-network-list_length' value='`$vnf-network-list_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vnf-network-list_length == 0`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='matching-error' value="`'Unable to find VNF with customization UUID of ' + $vnf-ids[vnf-ids-index] + ' for service instance ' + $serv-inst.service-instance-id`" />
+ </set>
+ <set>
+ <parameter name='mismatch' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$mismatch`'>
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='serv-inst.api' value='GR' />
+ </set>
+ <set>
+ <parameter name='serv-inst.vnf-list_length'
+ value='`$mdsal-service.service[0].service-data.vnfs.vnf_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-populate-from-vnfapi.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-populate-from-vnfapi.xml
new file mode 100755
index 00000000..e84e4268
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-populate-from-vnfapi.xml
@@ -0,0 +1,569 @@
+<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='getpathsegment-populate-from-vnfapi' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name="serv-inst.api" value= ""/>
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ <outcome value='success'>
+ <block>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: read properties file."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: Could not read properties file."/>
+ <parameter name="field3" value='`$prop.restapi.pm.getpolicy.templatefile`'/>
+ </record>
+ <set>
+ <parameter name="serv-inst.api" value= ""/>
+ <parameter name="error-message" value="Could not read properties file" />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ <switch test='`$serv-inst.service-instance-id`'>
+ <outcome value=''>
+ <block>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: input service-instance-id is not set"/>
+ </record>
+ <set>
+ <parameter name="serv-inst.api" value= ""/>
+ <parameter name="error-message" value="serv-inst.service-instance-id is not set" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$match-type`'>
+ <outcome value=''>
+ <block>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: input match-type is not set"/>
+ </record>
+ <set>
+ <parameter name="serv-inst.api" value= ""/>
+ <parameter name="error-message" value="input match-type is not set" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-ids_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name="path-type" value= "COMPOSITE"/>
+ </set>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: input vnf-ids_length is blank, this is a COMPOSITE path"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name="path-type" value= "SIMPLE"/>
+ </set>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: input vnf-ids_length is NOT blank, this is a SIMPLE path"/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="vnfListIndex" value= "0"/>
+ </set>
+ <switch test='`$path-type`'>
+ <outcome value='SIMPLE'>
+ <block>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: Call AAI custom query vfModule-fromServiceInstance to get vf-module-ids"/>
+ </record>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.vf-module-ids">
+ <parameter name="start[0]" value="`'/nodes/service-instances/service-instance?service-instance-id=' + $serv-inst.service-instance-id `" />
+ <!--<parameter name="start[0]" value="`'/business/customers/customer/bgb-customer/service-subscriptions/service-subscription/bgb-service-type/service-instances' `" />-->
+ <!--<parameter name="start[0]" value="`'/business/customers/customer/la-customer/service-subscriptions/service-subscription/la-service-type/service-instances' `" />-->
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="/query/vfModule-fromServiceInstance" />
+ <!--<parameter name="query" value="/query/vnfs-fromServiceInstance" /> -->
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query: vfModule-fromServiceInstance" />
+ <parameter name="serv-inst.api" value= ""/>
+ <parameter name='tmp.vf-module-ids_length' value='0' />
+ <parameter name='tmp.vnf-instances_length' value='0' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-message" value="No vfModules returned from AAI: vfModule-fromService-instance" />
+ <parameter name="serv-inst.api" value= ""/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <for index='vfModuleResultIndex' start='0' end='`$tmp.AnAI-data.vf-module-ids.results_length`' >
+ <set>
+ <parameter name="`'tmp.vf-module-ids[' + $vfModuleResultIndex + ']'`" value='`$tmp.AnAI-data.vf-module-ids.results[$vfModuleResultIndex].vf-module.vf-module-id`' />
+ </set>
+ </for>
+ <set>
+ <parameter name='tmp.vf-module-ids_length' value='`$tmp.AnAI-data.vf-module-ids.results_length`' />
+ </set>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name="tmp.triplet-list_length" value= "0" />
+ <parameter name="tmp.tripletListIndex" value= "0" />
+ <parameter name="tmp.vnf-instances_length" value= "0" />
+ <parameter name="tmp.vnfInstancesIndex" value= "0" />
+ <parameter name="tmp.mdsal-error-encountered" value= "false"/>
+ </set>
+ <for index='vfModuleIndex' start='0' end='`$tmp.vf-module-ids_length`' >
+ <block>
+ <set>
+ <parameter name="tmp.vnf-url" value="`'/restconf/config/VNF-API:vnfs/vnf-list/' + $tmp.vf-module-ids[$vfModuleIndex]`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vnf-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="vnf-mdsal" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-message" value="Failed to read vnf info from MD-SAL" />
+ <parameter name="serv-inst.api" value= ""/>
+ <parameter name="tmp.mdsal-error-encountered" value= "true"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-message" value="Cannot find vnf info in MD-SAL" />
+ <parameter name="serv-inst.api" value= ""/>
+ <parameter name="tmp.mdsal-error-encountered" value= "true"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name="`'tmp.vnf-instances[' + $tmp.vnfInstancesIndex + ']'`." value= '`$vnf-mdsal.vnf-list[0].`' />
+ <parameter name="genericVnfIdFound" value= 'false' />
+ </set>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: MDSAL vnf-instances vnf-id|generic-vnf-id: "/>
+ <parameter name="field3" value='`$tmp.vnf-instances[$tmp.vnfInstancesIndex].service-data.vnf-request-information.vnf-id`' />
+ <parameter name="field4" value='`$tmp.vnf-instances[$tmp.vnfInstancesIndex].service-data.vnf-request-information.generic-vnf-id`' />
+ </record>
+ <for index='tmp.tripletListIndex2' start='0' end='`$tmp.triplet-list_length`' >
+ <switch test='`$tmp.triplet-list[$tmp.tripletListIndex2].generic-vnf-id == $tmp.vnf-instances[$tmp.vnfInstancesIndex].service-data.vnf-request-information.generic-vnf-id`'>
+ <outcome value='false'></outcome>
+ <outcome value='true'>
+ <set>
+ <parameter name="genericVnfIdFound" value= 'true' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$genericVnfIdFound`'>
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name="`'tmp.triplet-list[' + $tmp.tripletListIndex + '].generic-vnf-id'`" value= '`$vnf-mdsal.vnf-list[0].service-data.vnf-request-information.generic-vnf-id`' />
+ <parameter name="`'tmp.triplet-list[' + $tmp.tripletListIndex + '].vf-module-id'`" value= '`$tmp.vf-module-ids[$vfModuleIndex]`' />
+ <parameter name="tmp.triplet-list_length" value= '`$tmp.triplet-list_length + 1`'/>
+ <parameter name="tmp.tripletListIndex" value= '`$tmp.tripletListIndex + 1`'/>
+ </set>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: generic-vnf-id in NOT found in triplet-list, add it"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: generic-vnf-id is already in triplet-list, don't add it"/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.vnfInstancesIndex" value= '`$tmp.vnfInstancesIndex + 1`'/>
+ <parameter name="tmp.vnf-instances_length" value= '`$tmp.vnf-instances_length + 1`'/>
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </for>
+ <switch test='`$tmp.mdsal-error-encountered`'>
+ <outcome value='false'>
+ <block>
+ <for index='tmp.tripletListIndex' start='0' end='`$tmp.triplet-list_length`' >
+ <block>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $tmp.triplet-list[$tmp.tripletListIndex].generic-vnf-id"
+ pfx='aai.generic-vnf' local-only='false' >
+ <outcome value='success'>
+ <switch test='`$aai.generic-vnf.model-customization-id`'>
+ <outcome value=''>
+ <block>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: model-customization-id is BLANK for vf-module-id|generic-vnf-id: "/>
+ <parameter name="field3" value='`$tmp.triplet-list[$tmp.tripletListIndex].vf-module-id`'/>
+ <parameter name="field4" value='`$tmp.triplet-list[$tmp.tripletListIndex].generic-vnf-id`'/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: Set model-customization-id for vf-module-id|generic-vnf-id: "/>
+ <parameter name="field3" value='`$tmp.triplet-list[$tmp.tripletListIndex].vf-module-id`'/>
+ <parameter name="field4" value='`$tmp.triplet-list[$tmp.tripletListIndex].generic-vnf-id`'/>
+ <parameter name="field5" value='`$aai.generic-vnf.model-customization-id`'/>
+ </record>
+ <set>
+ <parameter name="`'tmp.triplet-list[' + $tmp.tripletListIndex + '].model-customization-id'`" value= '`$aai.generic-vnf.model-customization-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='not-found'>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: generic-vnf not found in AAI for generic-vnf-id: "/>
+ <parameter name="field4" value='`$tmp.triplet-list[$tmp.tripletListIndex].generic-vnf-id`'/>
+ </record>
+ </outcome>
+ <outcome value='Other'>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: unable to access AAI for generic-vnf-id: "/>
+ <parameter name="field4" value='`$tmp.triplet-list[$tmp.tripletListIndex].generic-vnf-id`'/>
+ </record>
+ </outcome>
+ </get-resource>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block></block>
+ </outcome>
+ </switch>
+ <block>
+ <for index='tmp.tripletListIndex' start='0' end='`$tmp.triplet-list_length`' >
+ <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="LAINA: getpathsegment-populate-from-vnfapi: PRINT triplet-list | vf-module-id:generic-vnf-id:model-customization-id | "/>
+ <parameter name="field3" value='`$tmp.tripletListIndex`'/>
+ <parameter name="field4" value='`$tmp.triplet-list[$tmp.tripletListIndex].vf-module-id`'/>
+ <parameter name="field5" value='`$tmp.triplet-list[$tmp.tripletListIndex].generic-vnf-id`'/>
+ <parameter name="field6" value='`$tmp.triplet-list[$tmp.tripletListIndex].model-customization-id`'/>
+ </record>
+ </for>
+ </block>
+ <for index='vnfIdIndex' start='0' end='`$vnf-ids_length`' >
+ <block>
+ <for index='tmp.tripletListIndex' start='0' end='`$tmp.triplet-list_length`' >
+ <block>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: vnfIdIndex:id | tripletListIndex:model-customization-id | : "/>
+ <parameter name="field3" value='`$vnfIdIndex`'/>
+ <parameter name="field4" value='`$vnf-ids[$vnfIdIndex]`'/>
+ <parameter name="field5" value='`$tmp.tripletListIndex`'/>
+ <parameter name="field6" value='`$tmp.triplet-list[$tmp.tripletListIndex].model-customization-id`'/>
+ </record>
+ <switch test='`$vnf-ids[$vnfIdIndex] == $tmp.triplet-list[$tmp.tripletListIndex].model-customization-id`'>
+ <outcome value='true'>
+ <block>
+ <for index='vnfInstanceIndex' start='0' end='`$tmp.vnf-instances_length`' >
+ <block>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: vnfIdIndex:id | vnfInstanceIndex:id | : "/>
+ <parameter name="field3" value='`$vnfIdIndex`'/>
+ <parameter name="field4" value='`$vnf-ids[$vnfIdIndex]`'/>
+ <parameter name="field5" value='`$vnfInstanceIndex`'/>
+ <parameter name="field6" value='`$tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-request-information.vnf-id`'/>
+ </record>
+ <switch test='`$tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-request-information.vnf-id == $tmp.triplet-list[$tmp.tripletListIndex].vf-module-id`'>
+ <outcome value='true'>
+ <block>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: MATCH for vnf-instances.vnf-id and triplet-list.vf-module-id: "/>
+ <parameter name="field3" value='`$tmp.triplet-list[$tmp.tripletListIndex].vf-module-id`'/>
+ </record>
+ <switch test='`$tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-topology-information.vnf-assignments.vnf-networks_length > 0`'>
+ <outcome value='true'>
+ <for index='vnfNetworksIndex' start='0' end='`$tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-topology-information.vnf-assignments.vnf-networks_length`' >
+ <block>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: MATCH for vnf-id and vnf-instances for vnf-id: "/>
+ <parameter name="field3" value='`$vnf-ids[$vnfIdIndex]`'/>
+ <parameter name="field4" value='`$tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-topology-information.vnf-assignments.vnf-networks[$vnfnetworksIndex].`'/>
+ </record>
+ <set>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-network-list[$vnfNetworksIndex].network-name" value= "`$tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-topology-information.vnf-assignments.vnf-networks[$vnfNetworksIndex].network-name`"/>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-network-list[$vnfNetworksIndex].network-role" value= "`$tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-topology-information.vnf-assignments.vnf-networks[$vnfNetworksIndex].network-role`"/>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-network-list[$vnfNetworksIndex].vf-module-id" value= "`$tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-request-information.vnf-id`"/>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-network-list_length" value= '`$vnfNetworksIndex + 1`'/>
+ </set>
+ </block>
+ </for>
+ </outcome>
+ <outcome value='false'>
+ <block>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: No vnf-networks found for vnf-id: "/>
+ <parameter name="field3" value='`$tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-request-information.vnf-id`' />
+ </record>
+ <set>
+ <parameter name='`tmp.vnf-instances[$vnfInstanceIndex].service-data.vnf-topology-information.vnf-assignments.vnf-networks_length' value="0" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-id" value= "`$tmp.triplet-list[$tmp.tripletListIndex].generic-vnf-id`"/>
+ </set>
+ <set>
+ <parameter name="vnfListIndex" value= '`$vnfListIndex + 1`'/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='false'></outcome>
+ </switch>
+ </block>
+ </for>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: MATCH for input vnf-id and triplet-list.model-customizaiton-id: "/>
+ <parameter name="field3" value='`$vnf-ids[$vnfIdIndex]`'/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='false'></outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='COMPOSITE'>
+ <block>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: Call AAI custom query vfModule-fromServiceInstance to get vf-module-ids"/>
+ </record>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.vf-module-ids">
+ <parameter name="start[0]" value="`'/nodes/service-instances/service-instance?service-instance-id=' + $serv-inst.service-instance-id `" />
+ <!--<parameter name="start[0]" value="`'/business/customers/customer/bgb-customer/service-subscriptions/service-subscription/bgb-service-type/service-instances' `" />-->
+ <!--<parameter name="start[0]" value="`'/business/customers/customer/la-customer/service-subscriptions/service-subscription/la-service-type/service-instances' `" />-->
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="/query/vfModule-fromServiceInstance" />
+ <!--<parameter name="query" value="/query/vnfs-fromServiceInstance" /> -->
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query: vfModule-fromServiceInstance" />
+ <parameter name="serv-inst.api" value= ""/>
+ <parameter name='tmp.vf-module-ids_length' value='0' />
+ <parameter name='tmp.vnf-instances_length' value='0' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-message" value="No vfModules returned from AAI: vfModule-fromService-instance" />
+ <parameter name="serv-inst.api" value= ""/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <for index='vfModuleResultIndex' start='0' end='`$tmp.AnAI-data.vf-module-ids.results_length`' >
+ <set>
+ <parameter name="`'tmp.vf-module-ids[' + $vfModuleResultIndex + ']'`" value='`$tmp.AnAI-data.vf-module-ids.results[$vfModuleResultIndex].vf-module.vf-module-id`' />
+ </set>
+ </for>
+ <set>
+ <parameter name='tmp.vf-module-ids_length' value='`$tmp.AnAI-data.vf-module-ids.results_length`' />
+ </set>
+ </block>
+ </outcome>
+ </save>
+ <for index='vfModuleIndex' start='0' end='`$tmp.vf-module-ids_length`' >
+ <block>
+ <set>
+ <parameter name="tmp.vnf-url" value="`'/restconf/config/VNF-API:vnfs/vnf-list/' + $tmp.vf-module-ids[$vfModuleIndex]`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.vnf-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="vnf-mdsal" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed to read vnf info from MD-SAL" />
+ <parameter name="serv-inst.api" value= ""/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Cannot find vnf info in MD-SAL" />
+ <parameter name="serv-inst.api" value= ""/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name="`'tmp.vnf-instances[0]'`." value= '`$vnf-mdsal.vnf-list[0].`' />
+ </set>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: MDSAL vnf-instances vnf-id: "/>
+ <parameter name="field3" value='`$tmp.vnf-instances[0].service-data.vnf-request-information.vnf-id`' />
+ </record>
+ </block>
+ </outcome>
+ </execute>
+ <switch test='`$tmp.vnf-instances[0].service-data.vnf-topology-information.vnf-assignments.vnf-networks_length > 0`'>
+ <outcome value='true'>
+ <for index='vnfNetworksIndex' start='0' end='`$tmp.vnf-instances[0].service-data.vnf-topology-information.vnf-assignments.vnf-networks_length`' >
+ <block>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: copy vnf-instance data to output: "/>
+ <parameter name="field3" value='`$tmp.vnf-instances[0].service-data.vnf-topology-information.vnf-assignments.vnf-networks[$vnfnetworksIndex].`'/>
+ </record>
+ <set>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-network-list[$vnfNetworksIndex].network-name" value= "`$tmp.vnf-instances[0].service-data.vnf-topology-information.vnf-assignments.vnf-networks[$vnfNetworksIndex].network-name`"/>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-network-list[$vnfNetworksIndex].network-role" value= "`$tmp.vnf-instances[0].service-data.vnf-topology-information.vnf-assignments.vnf-networks[$vnfNetworksIndex].network-role`"/>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-network-list[$vnfNetworksIndex].vf-module-id" value= "`$tmp.vnf-instances[0].service-data.vnf-request-information.vnf-id`"/>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-network-list_length" value= '`$vnfNetworksIndex + 1`'/>
+ </set>
+ </block>
+ </for>
+ </outcome>
+ <outcome value='false'>
+ <block>
+ <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="LAINA: getpathsegment-populate-from-vnfapi: No vnf-networks found for vnf-id: "/>
+ <parameter name="field3" value='`$tmp.vnf-instances[0].service-data.vnf-request-information.vnf-id`' />
+ </record>
+ <set>
+ <parameter name='`tmp.vnf-instances[0].service-data.vnf-topology-information.vnf-assignments.vnf-networks_length' value="0" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="serv-inst.vnf-list[$vnfListIndex].vnf-id" value= "`$vnf-mdsal.vnf-list[0].service-data.vnf-request-information.generic-vnf-id`"/>
+ </set>
+ <set>
+ <parameter name="vnfListIndex" value= '`$vnfListIndex + 1`'/>
+ </set>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="serv-inst.service-instance-id" value= "`$serv-inst.service-instance-id`"/>
+ <parameter name="serv-inst.vnf-list_length" value= "`$vnfListIndex`"/>
+ </set>
+ <switch test='`$serv-inst.vnf-list_length > 0`'>
+ <outcome value='true'>
+ <set>
+ <parameter name="serv-inst.api" value= "VNF"/>
+ </set>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/getpathsegment-populate-from-vnfapi-output.log' />
+ </execute>
+ <return status='success'></return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-simple-match-pair.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-simple-match-pair.xml
new file mode 100755
index 00000000..049f22e7
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-simple-match-pair.xml
@@ -0,0 +1,125 @@
+<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='getpathsegment-simple-match-pair' mode='sync'>
+ <for index='serv-insts-index' start='0' end='`$serv-insts_length`' >
+ <switch test='`$serv-insts[$serv-insts-index].vnf-list_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='error-message' value="`'Matching VNFs were not found in service instance '
+ + $serv-insts[$serv-insts-index].service-instance-id`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='error-message' value="`'Matching VNFs were not found in service instance '
+ + $serv-insts[$serv-insts-index].service-instance-id`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='matched-all-vnfs' value='true' />
+ </set>
+ <set>
+ <parameter name='serv-insts[$serv-insts-index].path-segments_length' value='0' />
+ </set>
+ <for index='left-vnf-index' start='0' end='`$serv-insts[$serv-insts-index].vnf-list_length - 1`' >
+ <block>
+ <set>
+ <parameter name='found-match' value='false' />
+ </set>
+ <set>
+ <parameter name='right-vnf-index' value='`$left-vnf-index + 1`' />
+ </set>
+ <switch test='`$match-type`'>
+ <outcome value='network-name'>
+ <for index='left-vnf-network-index' start='0' end='`$serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-network-list_length`' >
+ <block>
+ <for index='right-vnf-network-index' start='0' end='`$serv-insts[$serv-insts-index].vnf-list[$right-vnf-index].vnf-network-list_length`' >
+ <switch test='`( $serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name
+ == $serv-insts[$serv-insts-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-name )
+ and
+ ( $serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role
+ == $serv-insts[$serv-insts-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].network-role )`'>
+ <outcome value='true'>
+ <switch test="`$serv-insts[$serv-insts-index].vnf-list[$vnf-index].vnf-network-list[$vnf-network-index].network-name == 'oam'`">
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='ps-index' value='`$serv-insts[$serv-insts-index].path-segments_length`' />
+ </set>
+ <set>
+ <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].segment-id' value='`$ps-index + 1`' />
+ <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].left-service-instance-id'
+ value='`$serv-insts[$serv-insts-index].service-instance-id`' />
+ <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].left-vnf-instance-id'
+ value='`$serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-id`' />
+ <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].left-vf-module-id'
+ value='`$serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].right-service-instance-id'
+ value='`$serv-insts[$serv-insts-index].service-instance-id`' />
+ <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].right-vnf-instance-id'
+ value='`$serv-insts[$serv-insts-index].vnf-list[$right-vnf-index].vnf-id`' />
+ <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].right-vf-module-id'
+ value='`$serv-insts[$serv-insts-index].vnf-list[$right-vnf-index].vnf-network-list[$right-vnf-network-index].vf-module-id`' />
+ <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].network-name'
+ value='`$serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-name`' />
+ <parameter name='serv-insts[$serv-insts-index].path-segments[$ps-index].network-role'
+ value='`$serv-insts[$serv-insts-index].vnf-list[$left-vnf-index].vnf-network-list[$left-vnf-network-index].network-role`' />
+ <parameter name='serv-insts[$serv-insts-index].path-segments_length'
+ value='`$serv-insts[$serv-insts-index].path-segments_length + 1`' />
+ </set>
+ <set>
+ <parameter name='found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$found-match`">
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ <switch test="`$found-match`">
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='matched-all-vnfs' value='false' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$matched-all-vnfs`">
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='matching-error' value="`'Not able to find matches for all vnfs of service instance ' + $serv-insts[$serv-insts-index].service-instance-id`" />
+ </set>
+ <set>
+ <parameter name='serv-insts[$serv-insts-index].path-segments.' value='' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-topology-operation-create.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-topology-operation-create.xml
new file mode 100755
index 00000000..77d04d74
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-topology-operation-create.xml
@@ -0,0 +1,55 @@
+<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='getpathsegment-topology-operation-create' mode='sync'>
+ <block>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from FORWARDING_PATH WHERE service_uuid = $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid'
+ pfx='db.forwarding-path[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="System error reading FORWARDING_PATH 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 paths found for service UUID ' + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid + ' in FORWARDING_PATH table'`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <for index='path-index' start='0' end='`$db.forwarding-path_length`' >
+ <switch test='`$db.forwarding-path[$path-index].path-type`'>
+ <outcome value='VF'>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-create-simple-path' mode='sync' ></call>
+ </outcome>
+ <outcome value='Service Proxy'>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-create-composite-path' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unexpected path type ' + $db.forwarding-path[$path-index].path-type + ' in FORWARDING_PATH table'`" />
+ </return>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/gps.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>
+ </outcome>
+ </get-resource>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-topology-operation.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-topology-operation.xml
new file mode 100755
index 00000000..e6c2c9db
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_getpathsegment-topology-operation.xml
@@ -0,0 +1,36 @@
+<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='getpathsegment-topology-operation' mode='sync'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <call module='GENERIC-RESOURCE-API' rpc='validate-getpathsegment-input' mode='sync' ></call>
+ <set>
+ <parameter name='service-data.sdnc-request-header.' value='`$getpathsegment-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='service-data.request-information.' value='`$getpathsegment-topology-operation-input.request-information.`' />
+ <parameter name='service-data.service-information.' value='`$getpathsegment-topology-operation-input.service-information.`' />
+ <parameter name='service-data.service-request-input.' value='`$getpathsegment-topology-operation-input.service-request-input.`' />
+ </set>
+ <switch test='`$getpathsegment-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='create'>
+ <call module='GENERIC-RESOURCE-API' rpc='getpathsegment-topology-operation-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$getpathsegment-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
+ </return>
+ </outcome>
+ </switch>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_naming-policy-generate-name.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_naming-policy-generate-name.xml
new file mode 100755
index 00000000..2f6def60
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_naming-policy-generate-name.xml
@@ -0,0 +1,1116 @@
+<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='naming-policy-generate-name' mode='sync'>
+ <block atomic='true'>
+ <block atomic='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ <outcome value='success'>
+ <block atomic='true'>
+ <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="LAINA: naming-policy-generate-name: read properties file."/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <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="LAINA: naming-policy-generate-name: Could not read properties file."/>
+ <parameter name="field3" value='`$prop.restapi.pm.getpolicy.templatefile`'/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='501' />
+ <parameter name='error-message' value='naming-policy-generate-name: could not read generic-resource-api properties' />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <switch test='`$naming-policy-generate-name-input.naming-type`'>
+ <outcome value='VM'>
+ <set>
+ <parameter name='table-name' value="NAMING_POLICY_VM_NAME_INDEX" />
+ <parameter name='table-type' value="VM_INSTANCE" />
+ <parameter name='table-prefix-column' value="vm_name_prefix" />
+ </set>
+ </outcome>
+ <outcome value='VNFC'>
+ <switch test='`$naming-policy-generate-name-input.vm-name`'>
+ <outcome value=''>
+ <block>
+ <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="LAINA: naming-policy-generate-name: input.naming-type is VNFC but input.vm-name is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='505' />
+ <parameter name='error-message' value='naming-policy-generate-name: input.naming-type is VNFC but input.vm-name is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='table-name' value="NAMING_POLICY_VNFC_NAME_INDEX" />
+ <parameter name='table-type' value="VNFC_INSTANCE" />
+ <parameter name='table-prefix-column' value="vnfc_name_prefix" />
+ <parameter name='seq-length' value="0" />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='VNF'>
+ <set>
+ <parameter name='table-name' value="VNF_NAME_INDEX" />
+ <parameter name='table-type' value="VNF_INSTANCE" />
+ <parameter name='table-prefix-column' value="vnf_name_prefix" />
+ </set>
+ </outcome>
+ <outcome value='NETWORK'>
+ <set>
+ <parameter name='table-name' value="NETWORK_INSTANCE_NAME_INDEX" />
+ <parameter name='table-type' value="NETWORK_INSTANCE" />
+ <parameter name='table-prefix-column' value="network_instance_name_prefix" />
+ </set>
+ </outcome>
+ <outcome value='SERVICE'>
+ <set>
+ <parameter name='table-name' value="SERVICE_INSTANCE_NAME_INDEX" />
+ <parameter name='table-type' value="SERVICE_INSTANCE" />
+ <parameter name='table-prefix-column' value="service_instance_name_prefix" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <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="LAINA: naming-policy-generate-name: invalid input.naming-type."/>
+ <parameter name="field3" value='`$naming-policy-generate-name-input.naming-type`'/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='503' />
+ <parameter name='error-message' value='naming-policy-generate-name: Invalid input.naming-type' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$naming-policy-generate-name-input.policy-instance-name`'>
+ <outcome value=''>
+ <block>
+ <switch test='`$naming-policy-generate-name-input.action`'>
+ <outcome value='Other'>
+ <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="LAINA: naming-policy-generate-name: input.policy-instance-name is not set but input.policy is not ASSIGN"/>
+ </record>
+ </outcome>
+ <outcome value='ASSIGN'>
+ <block>
+ <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="LAINA: naming-policy-generate-name: input.policy-instance-name is not set and input.policy is ASSIGN"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='507' />
+ <parameter name='error-message' value='naming-policy-generate-name: input.policy-instance-name is not set and input.policy is ASSIGN' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$naming-policy-generate-name-input.query-parameter`'>
+ <outcome value=''>
+ <block>
+ <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="LAINA: naming-policy-generate-name: input.vfc-customization-uuid is not set"/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$naming-policy-generate-name-input.action`'>
+ <outcome value=''>
+ <block>
+ <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="LAINA: naming-policy-generate-name: input.action is not set or invalid"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <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="LAINA: naming-policy-generate-name: input.action is not set or invalid"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='ASSIGN | DELETE'></outcome>
+ </switch>
+ </block>
+ <switch test='`$naming-policy-generate-name-input.action`'>
+ <outcome value='ASSIGN'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.policy-name' value="`$naming-policy-generate-name-input.policy-instance-name`" />
+ </set>
+ <record plugin="com.att.sdnctl.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="LAINA: naming-policy-generate-name: restapi-call-node Call Policy Manager getPolicy"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.getpolicy.templatefile`" />
+ <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/getConfig'`" />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name='customHttpHeaders'
+ value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" />
+ <parameter name="responsePrefix" value="tmp.pm-response" />
+ <outcome value='failure'>
+ <block>
+ <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="LAINA: naming-policy-generate-name: Error calling Policy Manager getPolicy"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='502' />
+ <parameter name='error-message' value='naming-policy-generate-name: getPolicy call to Policy Manger failed' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <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="LAINA: naming-policy-generate-name: getPolicy SUCCESS"/>
+ <parameter name='field3' value='`$tmp.pm-response.type`' />
+ <parameter name='field4' value='`$tmp.pm-response.matchingConditions`' />
+ <parameter name='field5' value='`$tmp.pm-response.config`' />
+ <parameter name='field6' value='`$tmp.pm-response.response-code`' />
+ <parameter name='field7' value='`$tmp.pm-response.response-message`' />
+ </record>
+ <set>
+ <parameter name='naming-policy-config' value="`$tmp.pm-response.config`" />
+ </set>
+ <switch test='`$tmp.pm-response.response-code`'>
+ <outcome value='500'>
+ <block>
+ <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="LAINA: naming-policy-generate-name: Error calling Policy Manager getPolicy"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='502' />
+ <parameter name='error-message' value='naming-policy-generate-name: getPolicy call to Policy Manger failed' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='vnf-name' value="`$naming-policy-generate-name-input.generic-vnf-name`" />
+ <parameter name='constant-tag' value="`$naming-policy-generate-name-input.constant-tag`" />
+ <parameter name='sequence' value="`$naming-policy-generate-name-input.sequence`" />
+ </set>
+ <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="LAINA: naming-policy-generate-name: call jsonStringToCtx"/>
+ <parameter name='field3' value='`$naming-policy-config`' />
+ </record>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="naming-policy-config" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="true" />
+ <outcome value='failure'>
+ <block>
+ <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="LAINA: naming-policy-generate-name: Error calling jsonStringToCtx"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='504' />
+ <parameter name='error-message' value='naming-policy-generate-name: failed to parse Policy Manger getPolicy response' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <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="LAINA: naming-policy-generate-name: jsonStringToCtx SUCCESS: policy-instance-name|naming-models_length|constructed-name:"/>
+ <parameter name='field3' value='`$jsonContextPrefix.content.policy-instance-name`' />
+ <parameter name='field4' value='`$jsonContextPrefix.content.naming-models_length`' />
+ <parameter name='field5' value='`$constructed-name`' />
+ </record>
+ <for index='modelsIndex' start='0' end='`$jsonContextPrefix.content.naming-models_length`' >
+ <block atomic='true'>
+ <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="LAINA: naming-policy-generate-name: modelsIndex|naming-type|naming-recipe:"/>
+ <parameter name='field3' value='`$modelsIndex`' />
+ <parameter name='field4' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-type`' />
+ <parameter name='field5' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-recipe`' />
+ </record>
+ <set>
+ <parameter name='naming-recipe' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-recipe`' />
+ <parameter name='naming-type' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-type`' />
+ </set>
+ <switch test='`$naming-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='504' />
+ <parameter name='error-message' value='naming-policy-generate-name: naming-type in policy is blank' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$naming-recipe`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='504' />
+ <parameter name='error-message' value='naming-policy-generate-name: naming-recipe in policy is blank' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$naming-type == $naming-policy-generate-name-input.naming-type`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='original-name' value='`$naming-recipe`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$original-name`" />
+ <parameter name="regex" value="\|"/>
+ <parameter name="limit" value="10" />
+ <parameter name="ctx_memory_result_key" value="namingRecipeSplits" />
+ </execute>
+ <for index='sectionIndex' start='0' end='`$namingRecipeSplits_length`' >
+ <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="LAINA: naming-policy-generate-name: Split naming-recipe sectionIndex|section value"/>
+ <parameter name="field3" value="`$sectionIndex`" />
+ <parameter name="field4" value="`$namingRecipeSplits[$sectionIndex]`" />
+ </record>
+ <block>
+ <set>
+ <parameter name='section-value' value="`$namingRecipeSplits[$sectionIndex]`" />
+ </set>
+ <for index='propertiesIndex' start='0' end='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties_length`' >
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].property-name`" />
+ <parameter name="outputPath" value="property-name-trimmed" />
+ </execute>
+ <set>
+ <!--<parameter name='property-name' value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].property-name`" />-->
+ <parameter name='property-name' value="`$property-name-trimmed`" />
+ </set>
+ <switch test='`$property-name == $section-value`'>
+ <outcome value='true'>
+ <block>
+ <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="LAINA: naming-policy-generate-name: recipe section match: section-value|property-name:"/>
+ <parameter name="field3" value="`$section-value`" />
+ <parameter name="field4" value="`$property-name`" />
+ </record>
+ <block>
+ <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="LAINA: naming-policy-generate-name: propertiesIndex|source-endpoint|source-system|property-name:"/>
+ <parameter name='field3' value='`$propertiesIndex`' />
+ <parameter name='field4' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].source-endpoint`' />
+ <parameter name='field5' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].source-system`' />
+ <parameter name='field6' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].property-name`' />
+ </record>
+ <set>
+ <parameter name='source-system' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].source-system`' />
+ <parameter name='source-endpoint' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].source-endpoint`' />
+ <parameter name='property-name' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].property-name`' />
+ <parameter name='property-value' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].property-value`' />
+ </set>
+ <switch test='`$property-value`'>
+ <outcome value=''>
+ <block>
+ <switch test='`$source-system`'>
+ <outcome value="MD-SAL">
+ <block>
+ <switch test='`$property-name`'>
+ <outcome value="VMNAME">
+ <switch test='`$naming-policy-generate-name-input.vm-name`'>
+ <outcome value=''>
+ <block>
+ <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="LAINA: naming-policy-generate-name: required input.vm-name is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='506' />
+ <parameter name='error-message' value='naming-policy-generate-name: required input.vm-name is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name="resolved-source-endpoint" value="`$naming-policy-generate-name-input.vm-name`" />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="VNFNAME">
+ <switch test='`$naming-policy-generate-name-input.vnf-name`'>
+ <outcome value=''>
+ <block>
+ <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="LAINA: naming-policy-generate-name: required input.vnf-name is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='506' />
+ <parameter name='error-message' value='naming-policy-generate-name: required input.vnf-name is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name="resolved-source-endpoint" value="`$naming-policy-generate-name-input.vnf-name`" />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue' >
+ <parameter name="source" value="`$source-endpoint`" />
+ <!--<parameter name="source" value="`$naming-policy-generate-name-input.test-source-endpoint-path`" />-->
+ <parameter name="outputPath" value="resolved-source-endpoint" />
+ </execute>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="value-var" value="`$property-name + '-' + $naming-policy-generate-name-input.test-source-endpoint-resolved-value` " />
+ <parameter name="new-part" value="`$resolved-source-endpoint` " />
+ <!--<parameter name="new-part" value="`$naming-policy-generate-name-input.test-source-endpoint-resolved-value` " />-->
+ </set>
+ <set>
+ <parameter name="constructed-name" value="`$constructed-name + $new-part` " />
+ </set>
+ <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="LAINA: naming-policy-generate-name: source-system MD-SAL name-value pair|new-part|constructed-name:"/>
+ <parameter name="field3" value="`$name-var`" />
+ <parameter name="field4" value="`$value-var`" />
+ <parameter name="field5" value="`$new-part`" />
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="CONTEXT">
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue' >
+ <parameter name="source" value="`$source-endpoint`" />
+ <parameter name="outputPath" value="resolved-source-endpoint" />
+ </execute>
+ <set>
+ <parameter name="name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="value-var" value="`$property-name + '-' + $naming-policy-generate-name-input.test-source-endpoint-resolved-value` " />
+ <parameter name="new-part" value="`$resolved-source-endpoint` " />
+ <!--<parameter name="new-part" value="`$naming-policy-generate-name-input.test-source-endpoint-resolved-value` " />-->
+ </set>
+ <set>
+ <parameter name="constructed-name" value="`$constructed-name + $new-part` " />
+ </set>
+ <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="LAINA: naming-policy-generate-name: source-system CONTEXT name-value pair|new-part|constructed-name:"/>
+ <parameter name="field3" value="`$name-var`" />
+ <parameter name="field4" value="`$value-var`" />
+ <parameter name="field5" value="`$new-part`" />
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="TOSCA">
+ <switch test='`$naming-policy-generate-name-input.query-parameter`'>
+ <outcome value=''>
+ <block>
+ <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="LAINA: naming-policy-generate-name: input.query-parameter is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='506' />
+ <parameter name='error-message' value='naming-policy-generate-name: input.query-parameter is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <execute plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' method='parameterizedQuery' emitsOutcome='true' >
+ <!--<parameter name='query' value='select nfc_naming_code from VFC_MODEL where customization_uuid = ?' />-->
+ <parameter name='query' value="`$source-endpoint`" />
+ <parameter name='prefix' value='queryPfx' />
+ <parameter name='param1' value="`$naming-policy-generate-name-input.query-parameter`" />
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='514' />
+ <parameter name='error-message' value='naming-policy-generate-name query-parameter not found in DB table'/>
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='515' />
+ <parameter name='error-message' value='naming-policy-generate-name database access failure'/>
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='original-name' value='`$source-endpoint`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$original-name`" />
+ <parameter name="regex" value=" "/>
+ <parameter name="limit" value="10" />
+ <parameter name="ctx_memory_result_key" value="sourceEndpointSplits" />
+ </execute>
+ <set>
+ <parameter name="query-parameter-name-underbars" value="`$sourceEndpointSplits[1]`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$query-parameter-name-underbars`"/>
+ <parameter name="outputPath" value="tmp.query-parameter-name-dashes"/>
+ <parameter name="target" value="_"/>
+ <parameter name="replacement" value="-"/>
+ </execute>
+ <set>
+ <parameter name="full-query-param-name" value="`'queryPfx.' + $tmp.query-parameter-name-dashes`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue' >
+ <parameter name="source" value="`$full-query-param-name`" />
+ <parameter name="outputPath" value="resolved-query-parameter" />
+ </execute>
+ <set>
+ <parameter name="name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="value-var" value="`$property-name + '-' + $resolved-query-parameter`" />
+ <parameter name="new-part" value="`$resolved-query-parameter` " />
+ </set>
+ <set>
+ <parameter name="constructed-name" value="`$constructed-name + $new-part` " />
+ </set>
+ <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="LAINA: naming-policy-generate-name: source-system TOSCA name-value pair|new-part|constructed-name:"/>
+ <parameter name="field3" value="`$name-var`" />
+ <parameter name="field4" value="`$value-var`" />
+ <parameter name="field5" value="`$new-part`" />
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value="AAI">
+ <block>
+ <set>
+ <parameter name='original-name' value='`$source-endpoint`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$original-name`" />
+ <parameter name="regex" value="\|"/>
+ <parameter name="limit" value="10" />
+ <parameter name="ctx_memory_result_key" value="aaiSourceEndpointRegionKeySplits" />
+ </execute>
+ <set>
+ <parameter name="resource" value="`$aaiSourceEndpointRegionKeySplits[0]`" />
+ <parameter name="keys" value="`$aaiSourceEndpointRegionKeySplits[1]`" />
+ <parameter name='aai-constructed-name' value="" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$keys`" />
+ <parameter name="regex" value="\:"/>
+ <parameter name="limit" value="10" />
+ <parameter name="ctx_memory_result_key" value="aaiSourceEndpointKeySplits" />
+ </execute>
+ <for index='keyIndex' start='0' end='`$aaiSourceEndpointKeySplits_length`' >
+ <block>
+ <set>
+ <parameter name='key-value' value="`$aaiSourceEndpointKeySplits[$keyIndex]`" />
+ </set>
+ <for index='propIndex' start='0' end='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties_length`' >
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].property-name`" />
+ <parameter name="outputPath" value="property-name-trimmed" />
+ </execute>
+ <set>
+ <!--<parameter name='property-name' value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].property-name`" />-->
+ <parameter name='property-name' value="`$property-name-trimmed`" />
+ </set>
+ <switch test='`$property-name == $key-value`'>
+ <outcome value='true'>
+ <block>
+ <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="LAINA: naming-policy-generate-name: key match: key-value|property-name:"/>
+ <parameter name="field3" value="`$key-value`" />
+ <parameter name="field4" value="`$property-name`" />
+ </record>
+ <block>
+ <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="LAINA: naming-policy-generate-name: propertiesIndex|source-endpoint|source-system|property-name:"/>
+ <parameter name='field3' value='`$propertiesIndex`' />
+ <parameter name='field4' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].source-endpoint`' />
+ <parameter name='field5' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].source-system`' />
+ <parameter name='field6' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].property-name`' />
+ </record>
+ <set>
+ <parameter name='source-system' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].source-system`' />
+ <parameter name='source-endpoint' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].source-endpoint`' />
+ <parameter name='property-name' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].property-name`' />
+ <parameter name='property-value' value='`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propIndex].property-value`' />
+ </set>
+ <switch test='`$property-value`'>
+ <outcome value=''>
+ <block>
+ <switch test='`$source-system`'>
+ <outcome value="CONTEXT">
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='getAttributeValue' >
+ <parameter name="source" value="`$source-endpoint`" />
+ <parameter name="outputPath" value="resolved-source-endpoint" />
+ </execute>
+ <set>
+ <parameter name="aai-name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="aai-value-var" value="`$property-name + '-' + $naming-policy-generate-name-input.test-source-endpoint-resolved-value` " />
+ <parameter name="aai-new-part" value="`$resolved-source-endpoint` " />
+ <!--<parameter name="new-part" value="`$naming-policy-generate-name-input.test-source-endpoint-resolved-value` " />-->
+ </set>
+ <switch test='`$aai-constructed-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name="aai-constructed-name" value="`$aai-new-part `" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name="aai-constructed-name" value="`$aai-constructed-name + '|' + $aai-new-part`" />
+ </set>
+ </outcome>
+ </switch>
+ <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="LAINA: naming-policy-generate-name: source-system CONTEXT name-value pair|aai-new-part|aai-constructed-name:"/>
+ <parameter name="field3" value="`$aai-name-var`" />
+ <parameter name="field4" value="`$aai-value-var`" />
+ <parameter name="field5" value="`$aai-new-part`" />
+ <parameter name="field6" value="`$aai-constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <!-- until PM is passing the correct source-endpoint for memory value,
+ use one passed via executeDG test
+
+<parameter name="`$propertiesIndex` + '-naming-property-value'" value="` $property-name + '-' + $source-endpoint `" />
+-->
+ <parameter name="aai-name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="aai-value-var" value="`$property-name + '-' + $property-value` " />
+ <parameter name="aai-new-part" value="`$property-value` " />
+ </set>
+ <switch test='`$aai-constructed-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name="aai-constructed-name" value="`$aai-new-part `" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name="aai-constructed-name" value="`$aai-constructed-name + '|' + $aai-new-part`" />
+ </set>
+ </outcome>
+ </switch>
+ <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="LAINA: naming-policy-generate-name: source-system CONTEXT name-value pair|aai-new-part|aai-constructed-name:"/>
+ <parameter name="field3" value="`$aai-name-var`" />
+ <parameter name="field4" value="`$aai-value-var`" />
+ <parameter name="field5" value="`$aai-new-part`" />
+ <parameter name="field6" value="`$aai-constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$aai-constructed-name`" />
+ <parameter name="regex" value="\|"/>
+ <parameter name="limit" value="10" />
+ <parameter name="ctx_memory_result_key" value="aaiQueryKeySplits" />
+ </execute>
+ <set>
+ <parameter name="`'tmp.' + $aaiSourceEndpointKeySplits[0]`" value= "`$aaiQueryKeySplits[0]`"/>
+ <parameter name="`'tmp.' + $aaiSourceEndpointKeySplits[1]`" value="`$aaiQueryKeySplits[1]`" />
+ <parameter name="`'tmp.' + $aaiSourceEndpointKeySplits[2]`" value="`$aaiQueryKeySplits[2]`" />
+ <!--<parameter name="aaiQueryKeyPart1" value="cloud-region.cloud-owner = 'att-aic' AND " />-->
+ <parameter name="aaiQueryKeyPart1" value="`$aaiSourceEndpointKeySplits[0]`"/>
+ <parameter name="aaiQueryKeyPart2" value=" = '" />
+ <parameter name="aaiQueryKeyPart3" value="`$aaiQueryKeySplits[0]`" />
+ <parameter name="aaiQueryKeyPart4" value="' AND " />
+ <parameter name="aaiQueryKeyPart5" value="`$aaiSourceEndpointKeySplits[1]`"/>
+ <parameter name="aaiQueryKeyPart6" value=" = '" />
+ <parameter name="aaiQueryKeyPart7" value="`$aaiQueryKeySplits[1]`" />
+ <parameter name="aaiQueryKeyPart8" value="' AND " />
+ <parameter name="aaiQueryKeyPart9" value="`$aaiSourceEndpointKeySplits[2]`"/>
+ <parameter name="aaiQueryKeyPart10" value=" = '" />
+ <parameter name="aaiQueryKeyPart11" value="`$aaiQueryKeySplits[2]`" />
+ <parameter name="aaiQueryKeyPart12" value="'" />
+ <parameter name="aaiQueryKey" value="`$aaiQueryKeyPart1 + $aaiQueryKeyPart2 + $aaiQueryKeyPart3 + $aaiQueryKeyPart4 + $aaiQueryKeyPart5 + $aaiQueryKeyPart6 + $aaiQueryKeyPart7 + $aaiQueryKeyPart8 + $aaiQueryKeyPart9 + $aaiQueryKeyPart10 + $aaiQueryKeyPart11 + $aaiQueryKeyPart12 `" />
+ <!-- works without single quotes <parameter name="aaiQueryKey" value="`'cloud-region.cloud-owner = att-aic AND ' + $aaiSourceEndpointKeySplits[0] + ' = ' + $aaiQueryKeySplits[0] + ' AND ' + $aaiSourceEndpointKeySplits[1] + ' = ' + $aaiQueryKeySplits[1]`" />-->
+ <!-- key="cloud-region.cloud-owner = '$a' AND cloud-region.cloud-region-id = '$b' AND tenant.tenant-id = '$c' AND vserver.vserver-id = '$d'" -->
+ <!--<parameter name="`'get-data-from-policy-output[' + $policyDataIndex + ']'`." value= '`$jsonContextPrefix.content.policy-data[$policyDataIndex].`' />-->
+ </set>
+ <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="LAINA: naming-policy-generate-name: Call AAI query for keys aai-constructed-name|region|aaiQueryKey:"/>
+ <parameter name="field3" value="`$aai-constructed-name`" />
+ <parameter name="field4" value="`$resource`" />
+ <parameter name="field5" value="`$aaiQueryKey`" />
+ </record>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource='`$resource`'
+ key='`$aaiQueryKey`'
+ pfx="`'aai.' + $resource`" local-only='true' >
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.tenant-name' value='`$aai.tenant.tenant-name`' />
+ </set>
+ </block>
+ </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="Tenant not found in AAI" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Tenant not found in AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name="name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="value-var" value="`$property-name + '-' + $tmp.tenant-name`" />
+ <parameter name="new-part" value="`$tmp.tenant-name` " />
+ </set>
+ <set>
+ <parameter name="constructed-name" value="`$constructed-name + $new-part` " />
+ </set>
+ <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="LAINA: naming-policy-generate-name: source-system AAI name-value pair|new-part|constructed-name:"/>
+ <parameter name="field3" value="`$name-var`" />
+ <parameter name="field4" value="`$value-var`" />
+ <parameter name="field5" value="`$new-part`" />
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ </block>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block>
+ <set>
+ <!-- until PM is passing the correct source-endpoint for memory value,
+ use one passed via executeDG test
+
+<parameter name="`$propertiesIndex` + '-naming-property-value'" value="` $property-name + '-' + $source-endpoint `" />
+-->
+ <parameter name="seq-scope" value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].increment-sequence.scope`" />
+ <parameter name="seq-start-value" value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].increment-sequence.start-value` " />
+ <parameter name="seq-length" value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].increment-sequence.length` " />
+ <parameter name="seq-increment" value="`$jsonContextPrefix.content.naming-models[$modelsIndex].naming-properties[$propertiesIndex].increment-sequence.increment` " />
+ </set>
+ <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="LAINA: naming-policy-generate-name: SDN-GC SEQUENCE info: scope|start-value|length|increment|constructed-name:"/>
+ <parameter name="field3" value="`$seq-scope`" />
+ <parameter name="field4" value="`$seq-start-value`" />
+ <parameter name="field5" value="`$seq-length`" />
+ <parameter name="field6" value="`$seq-increment`" />
+ <parameter name="field7" value="`$constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <!-- until PM is passing the correct source-endpoint for memory value,
+ use one passed via executeDG test
+
+<parameter name="`$propertiesIndex` + '-naming-property-value'" value="` $property-name + '-' + $source-endpoint `" />
+-->
+ <parameter name="name-var" value="`$propertiesIndex + '-naming-property-value'`" />
+ <parameter name="value-var" value="`$property-name + '-' + $property-value` " />
+ <parameter name="new-part" value="`$property-value` " />
+ </set>
+ <set>
+ <parameter name="constructed-name" value="`$constructed-name + $new-part` " />
+ </set>
+ <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="LAINA: naming-policy-generate-name: property-value name-value pair|new-part|constructed-name:"/>
+ <parameter name="field3" value="`$name-var`" />
+ <parameter name="field4" value="`$value-var`" />
+ <parameter name="field5" value="`$new-part`" />
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ <block atomic='true'>
+ <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="LAINA: naming-policy-generate-name: call generate-unique-name: constructed-name"/>
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ <set>
+ <!--<parameter name='generate-unique-name-input.index-table-name' value='VM_NAME_INDEX' />-->
+ <parameter name='generate-unique-name-input.index-table-name' value="`$table-name`" />
+ <parameter name='generate-unique-name-input.index-table-prefix-column' value="`$table-prefix-column`" />
+ <!--<parameter name='generate-unique-name-input.name-table-type' value='VNFAPI_VM_INSTANCE' />-->
+ <parameter name='generate-unique-name-input.name-table-type' value="`$table-type`" />
+ <!--<parameter name='generate-unique-name-input.prefix' value="`$naming-policy-generate-name-input.nfc-naming-code`" /><parameter name='generate-unique-name-input.index-length' value='003' />-->
+ <parameter name='generate-unique-name-input.prefix' value="`$constructed-name`" />
+ <parameter name='generate-unique-name-input.index-length' value="`$seq-length`" />
+ <parameter name='generate-unique-name-input.action' value="`$naming-policy-generate-name-input.action`" />
+ <parameter name='generate-unique-name-input.context-id' value="`$naming-policy-generate-name-input.context-id`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-unique-name' mode='sync' >
+ <outcome value='failure'>
+ <block>
+ <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="LAINA: naming-policy-generate-name: Error calling generate-unique-name"/>
+ </record>
+ <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>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$naming-type`'>
+ <outcome value="VM">
+ <!-- <outcome value="MD-SAL"> -->
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.vm-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <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="LAINA: naming-policy-generate-name: generated vm-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.vm-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="VNFC">
+ <!-- <outcome value="MD-SAL"> -->
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.vnfc-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <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="LAINA: naming-policy-generate-name: generated vnfc-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.vnfc-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="VNF">
+ <!-- <outcome value="MD-SAL"> -->
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.vnf-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <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="LAINA: naming-policy-generate-name: generated vnf-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.vnf-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="NETWORK">
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.network-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <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="LAINA: naming-policy-generate-name: generated network-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.network-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="SERVICE">
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.service-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <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="LAINA: naming-policy-generate-name: generated service-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.service-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </call>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <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="LAINA: naming-policy-generate-name: naming-type from returned policy does not match input.naming-type. Do not construct name for: "/>
+ <parameter name="field3" value="`$naming-type`" />
+ </record>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/naming-policy-generate-name.log' />
+ </execute>
+ <return status='success'>
+ <parameter name='naming-policy-generate-name-output.vm-name' value="`$naming-policy-generate-name-output.vm-name`" />
+ <parameter name='naming-policy-generate-name-output.vnfc-name' value="`$naming-policy-generate-name-output.vnfc-name`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='DELETE'>
+ <block atomic='true'>
+ <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="LAINA: naming-policy-generate-name: call generate-unique-name: constructed-name"/>
+ <parameter name="field6" value="`$constructed-name`" />
+ </record>
+ <set>
+ <!--<parameter name='generate-unique-name-input.index-table-name' value='VM_NAME_INDEX' />-->
+ <parameter name='generate-unique-name-input.index-table-name' value="`$table-name`" />
+ <parameter name='generate-unique-name-input.index-table-prefix-column' value="`$table-prefix-column`" />
+ <!--<parameter name='generate-unique-name-input.name-table-type' value='VNFAPI_VM_INSTANCE' />-->
+ <parameter name='generate-unique-name-input.name-table-type' value="`$table-type`" />
+ <!--<parameter name='generate-unique-name-input.prefix' value="`$naming-policy-generate-name-input.nfc-naming-code`" /><parameter name='generate-unique-name-input.index-length' value='003' />-->
+ <parameter name='generate-unique-name-input.prefix' value="`$constructed-name`" />
+ <parameter name='generate-unique-name-input.index-length' value="`$seq-length`" />
+ <parameter name='generate-unique-name-input.action' value="`$naming-policy-generate-name-input.action`" />
+ <parameter name='generate-unique-name-input.context-id' value="`$naming-policy-generate-name-input.context-id`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-unique-name' mode='sync' >
+ <outcome value='failure'>
+ <block>
+ <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="LAINA: naming-policy-generate-name: Error calling generate-unique-name"/>
+ </record>
+ <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>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$naming-type`'>
+ <outcome value="VM">
+ <!-- <outcome value="MD-SAL"> -->
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.vm-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <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="LAINA: naming-policy-generate-name: generated vm-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.vm-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="VNFC">
+ <!-- <outcome value="MD-SAL"> -->
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.vnfc-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <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="LAINA: naming-policy-generate-name: generated vnfc-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.vnfc-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="VNF">
+ <!-- <outcome value="MD-SAL"> -->
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.vnf-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <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="LAINA: naming-policy-generate-name: generated vnf-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.vnf-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="NETWORK">
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.network-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <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="LAINA: naming-policy-generate-name: generated network-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.network-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value="SERVICE">
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-output.service-name' value='`$generate-unique-name-output.generated-name`' />
+ <parameter name='constructed-name' value='' />
+ <parameter name='seq-length' value='' />
+ </set>
+ <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="LAINA: naming-policy-generate-name: generated service-name|generate-unique-name-output.generated-name:"/>
+ <parameter name="field5" value="`$naming-policy-generate-name-output.service-name`" />
+ <parameter name="field6" value="`$generate-unique-name-output.generated-name`" />
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_naming-policy-generate-unique-name.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_naming-policy-generate-unique-name.xml
new file mode 100644
index 00000000..23aece7c
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_naming-policy-generate-unique-name.xml
@@ -0,0 +1,182 @@
+<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='naming-policy-generate-unique-name' mode='sync'>
+ <block atomic="true">
+ <switch test='`$generate-unique-name-input.action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.action not supplied' />
+ </return>
+ </outcome>
+ <outcome value='ASSIGN'>
+ <block atomic="true">
+ <switch test='`$generate-unique-name-input.context-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-message'
+ value="generate-unique-name-input.context-id cannot be null for ASSIGN action" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generate-unique-name-input.name-table-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.name-table-type not supplied' />
+ </return>
+ </outcome>
+ <outcome value='VNF_INSTANCE'>
+ <set>
+ <parameter name='tmp.gname.custom-query-string' value='nodes/generic-vnfs?vnf-name=' />
+ </set>
+ </outcome>
+ <outcome value='VM_INSTANCE'>
+ <set>
+ <parameter name='tmp.gname.custom-query-string' value='nodes/vservers?vserver-name=' />
+ </set>
+ </outcome>
+ <outcome value='NETWORK_INSTANCE'>
+ <set>
+ <parameter name='tmp.gname.custom-query-string' value='nodes/l3-networks?network-name=' />
+ </set>
+ </outcome>
+ <outcome value='SERVICE_INSTANCE'>
+ <set>
+ <parameter name='tmp.gname.custom-query-string' value='nodes/service-instances?service-instance-name=' />
+ </set>
+ </outcome>
+ <outcome value='VNFC_INSTANCE'>
+ <set>
+ <parameter name='tmp.gname.custom-query-string' value='nodes/vnfcs?vnfc-name=' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.gun.nononap' value='NON-ONAP' />
+ </set>
+ <set>
+ <parameter name='tmp.gun.transient' value='TRANSIENT' />
+ </set>
+ <set>
+ <parameter name='tmp.grn.loop.flag' value='true' />
+ </set>
+ <while test='`$tmp.grn.loop.flag`'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='generate-unique-name' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.grn.loop.flag' value='false' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-message'
+ value="`'Encountered error in naming-policy-generate-unique-name: ' +
+ $generate-unique-name-output.error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="urlEncode">
+ <parameter name="source" value='`$generate-unique-name-output.generated-name`'/>
+ <parameter name="outputPath" value="encoded-name" />
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.nodes-query">
+ <parameter name="start[0]" value="`$tmp.gname.custom-query-string +
+ $encoded-name`" />
+ <parameter name="start_length" value="1" />
+ <outcome value='not-found'>
+ <set>
+ <parameter name='tmp.grn.loop.flag' value='false' />
+ </set>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.grn.loop.flag' value='false' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-message'
+ value="`'Error updating GENERIC_RESOURCE_NAME.context_id from TRANSIENT to '
+ + $tmp.context-id.nononap`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <update plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="update GENERIC_RESOURCE_NAME set context_id = $tmp.gun.nononap
+ WHERE type = $generate-unique-name-input.name-table-type
+ AND context_id = $tmp.gun.transient">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-message'
+ value="`'Error updating GENERIC_RESOURCE_NAME.context_id from TRANSIENT to '
+ + $tmp.context-id.nononap`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-message'
+ value="`'No GENERIC_RESOURCE_NAME found with context_id = TRANSIENT and type = '
+ + $generate-unique-name-input.name-table-type`"/>
+ </return>
+ </outcome>
+ </update>
+ </outcome>
+ </save>
+ </block>
+ </while>
+ <update plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="update GENERIC_RESOURCE_NAME set context_id = $generate-unique-name-input.context-id
+ WHERE type = $generate-unique-name-input.name-table-type
+ AND name = $generate-unique-name-output.generated-name
+ AND context_id = $tmp.gun.transient">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-message'
+ value="`'Error updating GENERIC_RESOURCE_NAME.context_id from TRANSIENT to '
+ + $tmp.context-id.nononap`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-message'
+ value="`'No GENERIC_RESOURCE_NAME found with context_id = TRANSIENT and type = '
+ + $generate-unique-name-input.name-table-type`"/>
+ </return>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ <outcome value='DELETE'>
+ <block atomic='true'>
+ <set>
+ <parameter name='rollback-generated-names-input.naming-type' value='`$generate-unique-name-input.name-table-type`' />
+ </set>
+ <set>
+ <parameter name='rollback-generated-names-input.context-id' value='`$generate-unique-name-input.context-id`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='rollback-generated-names' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-message'
+ value="`'Encountered error in rollback-generated-names: ' +
+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='generate-unique-name-output.error-message' value='Invalid generate-unique-name-input.action. Valid values are ASSIGN or DELETE' />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-activate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-activate.xml
index c8593b71..ed5130a3 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-activate.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-activate.xml
@@ -1,45 +1,102 @@
-<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='network-topology-operation-activate' mode='sync'>
-<block atomic="true"><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+<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='network-topology-operation-activate' mode='sync'>
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="l3-network"
- key="l3-network.network-id = $network-topology-operation-input.network-information.network-id"
+ key="l3-network.network-id = $network-topology-operation-input.network-information.network-id AND
+ depth = 'all'"
local-only="false"
pfx="aai.l3-network">
-<outcome value='not-found'>
-<return status='failure'>
- <parameter name="error-code" value="404" />
- <parameter name="error-message" value="network-id not found in AAI" /></return></outcome><outcome value='failure'>
-<return status='failure'>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="'Error retrieving l3-network with network-id=' + $network-topology-operation-input.network-request-information.network-id + 'from AnAI'" /></return></outcome></get-resource><switch test='`$aai.l3-network.subnets.subnet_length`'>
-<outcome value=''>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="no networks found" />
-</return></outcome><outcome value='Other'>
-<for index='sidx' start='0' end='`$aai.l3-network.subnets.subnet_length`' >
-<block atomic="true"><get-resource
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="network-id not found in AAI" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="'Error retrieving l3-network with network-id=' + $network-topology-operation-input.network-request-information.network-id + 'from AnAI'" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test='`$aai.l3-network.subnets.subnet_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="no networks found" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$network-data.network-topology.network-topology-identifier-structure.network-instance-group-id`'>
+ <outcome value=''>
+ <switch test='`$service-data.networks.network[$nidx].network-data.network-information.from-preload`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <for index='sidx' start='0' end='`$aai.l3-network.subnets.subnet_length`' >
+ <block atomic="true">
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $aai.l3-network.network-id
+ AND subnet.subnet-id = $aai.l3-network.subnets.subnet[$sidx].subnet-id" >
+ <parameter name="orchestration-status" value="Active" />
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet. Subnet not found." />
+ </return>
+ </outcome>
+ </update>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='sidx' start='0' end='`$aai.l3-network.subnets.subnet_length`' >
+ <block atomic="true">
+ <get-resource
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="SELECT * from EIPAM_IP_SUBNETS where entity_id = $aai.l3-network.subnets.subnet[$sidx].subnet-id ; "
pfx='tmp.eipam-subnet-row'>
-
-<outcome value='failure'>
-<return status="failure">
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNETS failed to find subnet matching aai subnet." />
- </return></outcome><outcome value="not-found"><return status="failure">
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Subnet not found in EIPAM_IP_SUBNETS - activate failed." />
- </return></outcome><outcome value='success'>
-<block atomic='true'><set>
- <parameter name="eipam-ip-block.entity-id" value="`$aai.l3-network.subnets.subnet[$sidx].subnet-id`"/>
- <parameter name="eipam-ip-block.plans[0].plan-name" value="`$tmp.eipam-subnet-row.plan-name`"/>
-</set><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="activateSubnet">
-<outcome value='failure'><return status="failure">
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while activating subnet in EIPAM." />
- </return></outcome></execute><save
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNETS failed to find subnet matching aai subnet." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Subnet not found in EIPAM_IP_SUBNETS - activate failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <set>
+ <parameter name="eipam-ip-block.entity-id" value="`$aai.l3-network.subnets.subnet[$sidx].subnet-id`"/>
+ <parameter name="eipam-ip-block.plans[0].plan-name" value="`$tmp.eipam-subnet-row.plan-name`"/>
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="activateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while activating subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <save
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="UPDATE EIPAM_IP_SUBNETS
@@ -47,54 +104,103 @@
WHERE entity_id = $eipam-ip-block.entity-id ; "
force='true'
pfx='pfx.eipam-subnet-row'>
-<outcome value='failure'>
-<return status="failure">
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while updating subnet to active in mysql." />
- </return></outcome><outcome value="not-found"><return status="failure">
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while updating subnet to active in mysql." />
- </return></outcome><outcome value='success'>
-<block atomic='true'><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while updating subnet to active in mysql." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while updating subnet to active in mysql." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="subnet"
key="l3-network.network-id = $aai.l3-network.network-id
AND subnet.subnet-id = $eipam-ip-block.entity-id" >
-<parameter name="orchestration-status" value="Created" />
- <outcome value='failure'>
-<return status="failure">
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet." />
- </return></outcome><outcome value="not-found"><return status="failure">
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet. Subnet not found." />
- </return></outcome></update></block></outcome></save></block></outcome></get-resource></block></for></outcome></switch><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ <parameter name="orchestration-status" value="Active" />
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet. Subnet not found." />
+ </return>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network collection activate failed" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="l3-network"
key="l3-network.network-id = $aai.l3-network.network-id" >
-<parameter name="orchestration-status" value="Active" /> <outcome value='failure'>
-<return status="failure">
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Failure updating orchestration-status in AAI for l3-network" />
- </return></outcome><outcome value="not-found"><return status="failure">
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Failure updating orchestration-status in AAI for l3-network. Network not found." />
- </return></outcome></update><set>
-<parameter name='service-data.networks.network[$nidx].network-data.sdnc-request-header.' value='`$network-topology-operation-input.sdnc-request-header.`' />
-<parameter name='service-data.networks.network[$nidx].network-data.request-information.' value='`$network-topology-operation-input.request-information.`' />
-</set><set>
-<parameter name='networkId' value='`$network-topology-operation-input.network-information.network-id`' />
-</set><set>
-<parameter name='network-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ <parameter name="orchestration-status" value="Active" />
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for l3-network" />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for l3-network. Network not found." />
+ </return>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.sdnc-request-header.' value='`$network-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.request-information.' value='`$network-topology-operation-input.request-information.`' />
+ </set>
+ <set>
+ <parameter name='networkId' value='`$network-topology-operation-input.network-information.network-id`' />
+ </set>
+ <set>
+ <parameter name='network-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ $network-topology-operation-input.service-information.service-instance-id
+ '/service-data/networks/network/'
+ $networkId
+ '/network-data/network-topology/'` " />
-
-</set><set>
-<parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status' value='Created' />
-<parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.last-rpc-action' value='`$network-topology-operation-input.sdnc-request-header.svc-action`' />
-<parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.last-action' value='`$network-topology-operation-input.request-information.request-action`' />
-</set><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>
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status' value='Created' />
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.last-rpc-action' value='`$network-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.last-action' value='`$network-topology-operation-input.request-information.request-action`' />
+ </set>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-assign-automated.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-assign-automated.xml
new file mode 100755
index 00000000..4de5c5fd
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-assign-automated.xml
@@ -0,0 +1,1405 @@
+<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='network-topology-operation-assign-automated' mode='sync'>
+ <block atomic="true">
+ <switch test="`$tmp.nidx`">
+ <outcome value=''>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='nidx' value='0' />
+ <parameter name='nidx_len' value='1'/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='nidx' value='`$service-data.networks.network_length`' />
+ <parameter name='nidx_len' value='`$service-data.networks.network_length + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='nidx' value='`$tmp.nidx`' />
+ <parameter name='nidx_len' value='`$service-data.networks.network_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.error-message" value=""/>
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.sdnc-request-header.' value='`$network-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.request-information.' value='`$network-topology-operation-input.request-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.service-information.' value='`$network-topology-operation-input.service-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-information.' value='`$network-topology-operation-input.network-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-request-input.' value='`$network-topology-operation-input.network-request-input.`' />
+ </set>
+ <set>
+ <parameter name='tmp.l3-network.model-invariant-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`" />
+ <parameter name='tmp.l3-network.model-version-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-version`" />
+ <parameter name='tmp.l3-network.model-customization-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`" />
+ <parameter name='s-onap-model-information.model-invariant-uuid' value='`$service-model.invariant-uuid`' />
+ <parameter name='s-onap-model-information.model-version' value='`$service-model.version`' />
+ <parameter name='s-onap-model-information.model-uuid' value='`$service-model.service-uuid`' />
+ <parameter name='s-onap-model-information.model-name' value='`$service-model.name`' />
+ <parameter name='n-onap-model-information.model-invariant-uuid' value='`$network-model.invariant-uuid`' />
+ <parameter name='n-onap-model-information.model-version' value='`$network-model.version`' />
+ <parameter name='n-onap-model-information.model-uuid' value='`$network-model.uuid`' />
+ <parameter name='n-onap-model-information.model-name' value='`$network-model.name`' />
+ </set>
+ <set>
+ <parameter name='network-data.service-information.ecomp-model-information.' value="`$s-onap-model-information.`" />
+ <parameter name='network-data.network-information.ecomp-model-information.' value="`$n-onap-model-information.`" />
+ </set>
+ <switch test='`$network-model.is-bound-to-vpn`'>
+ <outcome value='Y'>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VPN_BINDINGS WHERE network_customization_uuid = $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid'
+ pfx='vpn-bindings[]'>
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='hasVpnBindings' value='true' />
+ </set>
+ <for index='vidx' start='0' end='`$vpn-bindings_length`' >
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-binding.vpn-id = $vpn-bindings[$vidx].binding-uuid"
+ pfx='aai.vpnBinding' local-only='false' >
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'No vpn binding found for network-model.vpn-binding='
+ + $vpn-bindings[$vidx].binding-uuid`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'No vpn binding found for network-model.vpn-binding='
+ + $vpn-bindings[$vidx].binding-uuid`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Network model is_bound_to_vpn=true but no vpn_binding is present"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Unexpected error retrieving vpn binding"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.l3-network.network-id' value="`$tmp.return.generate-l3network-network-id.uuid`" />
+ <parameter name='tmp.l3-network.network-name' value="`$tmp.network-instance-name`" />
+ <parameter name='tmp.l3-network.network-type' value="`$network-model.network-type`" />
+ <parameter name='tmp.l3-network.network-role' value="`$network-model.network-role`" />
+ <parameter name='tmp.l3-network.network-technology' value="`$network-model.network-technology`" />
+ <parameter name='tmp.l3-network.is-bound-to-vpn' value="`$network-model.is-bound-to-vpn`" />
+ <parameter name='tmp.l3-network.orchestration-status' value="PendingCreate" />
+ <parameter name='tmp.l3-network.model-invariant-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`" />
+ <parameter name='tmp.l3-network.model-version-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-version`" />
+ <parameter name='tmp.l3-network.model-customization-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`" />
+ <parameter name='tmp.l3-network.is-provider-network' value="`$network-model.is-provider-network`" />
+ <parameter name='tmp.l3-network.is-shared-network' value="`$network-model.is-shared-network`" />
+ <parameter name='tmp.l3-network.is-external-network' value="`$network-model.is-external-network`" />
+ <parameter name='tmp.l3-network.eipam-v6-address-plan' value="`$network-model.eipam-v6-address-plan`" />
+ <parameter name='tmp.l3-network.eipam-v4-address-plan' value="`$network-model.eipam-v4-address-plan`" />
+ <parameter name='tmp.l3-network.service-id' value="`$service-data.service-information.service-id`" />
+ <parameter name='tmp.l3-network.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $network-topology-operation-input.service-information.service-instance-id
+ + '/service-data/networks/network/'
+ + $tmp.l3-network.network-id
+ + '/network-data/network-topology/'` " />
+ </set>
+ <switch test='`$network-model.is-provider-network`'>
+ <outcome value='Y'>
+ <set>
+ <parameter name='tmp.l3-network.physical-network-name' value="`$network-model.physical-network-name`" />
+ <parameter name='tmp.l3-network.is-provider-network-boolean' value='true' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.l3-network.physical-network-name' value="" />
+ <parameter name='tmp.l3-network.is-provider-network-boolean' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$network-model.is-shared-network`'>
+ <outcome value='Y'>
+ <set>
+ <parameter name='tmp.l3-network.is-shared-network-boolean' value='true' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.l3-network.is-shared-network-boolean' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$network-model.is-external-network`'>
+ <outcome value='Y'>
+ <set>
+ <parameter name='tmp.l3-network.is-external-network-boolean' value='true' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.l3-network.is-external-network-boolean' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$network-model.is-bound-to-vpn`'>
+ <outcome value='Y'>
+ <set>
+ <parameter name='tmp.l3-network.is-bound-to-vpn-boolean' value='true' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.l3-network.is-bound-to-vpn-boolean' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.complex-found' value='false' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cloud-region"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $network-topology-operation-input.network-request-input.aic-cloud-region AND
+ depth = '0'"
+ pfx='aai.cloud-region' local-only='false' >
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Cloud region not found in AAI"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error retrieving cloud region from AAI"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ <switch test='`$aai.cloud-region.relationship-list.relationship_length`'>
+ <outcome value='0'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Cloud region missing relationships in AAI"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Cloud region missing relationships in AAI"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <for silentFailure='false' index='ridx' start='0' end="`$aai.cloud-region.relationship-list.relationship_length`" >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='complex.physical-location-id'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.complex-found' value='true' />
+ </set>
+ <set>
+ <parameter name='service-data.network-request-input.aic-clli' value='`$aai.complex.physical-location-id`' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="complex"
+ key="complex.physical-location-id = $aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.complex' local-only='false' >
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$aai.complex.region`'>
+ <outcome value='USA'>
+ <block>
+ <set>
+ <parameter name='aai.complex.region' value='US' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='CALA'>
+ <block>
+ <set>
+ <parameter name='aai.complex.region' value='LA' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='CA'>
+ <block></block>
+ </outcome>
+ <outcome value='US'>
+ <block></block>
+ </outcome>
+ <outcome value='LA'>
+ <block></block>
+ </outcome>
+ <outcome value='EMEA'>
+ <block></block>
+ </outcome>
+ <outcome value='AP'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Complex.region unknown"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Complex not found in AAI"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Error retrieving complex from AA"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <switch test='`$tmp.complex-found`'>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Complex not found in AAI"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$network-model.network-technology`'>
+ <outcome value='Contrail'>
+ <block atomic="true">
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test='`$network-model.eipam-v4-address-plan`'>
+ <outcome value='AIC_ATM_UNPROTECTED_V4'>
+ <block></block>
+ </outcome>
+ <outcome value='AIC_ATM_PROTECTED_V4'>
+ <block></block>
+ </outcome>
+ <outcome value='AIC_AIM_LANDING_NETWORK_V4'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Invalid address plan for VIPR"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test='`$network-model.eipam-v6-address-plan`'>
+ <outcome value='AIC_ATM_UNPROTECTED_V6'>
+ <block></block>
+ </outcome>
+ <outcome value='AIC_ATM_PROTECTED_V6'>
+ <block></block>
+ </outcome>
+ <outcome value='AIC_AIM_LANDING_NETWORK_V6'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="EIPAM V6 Address plan should be null"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='AIC_SR_IOV'>
+ <block atomic="true">
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test='`$network-model.eipam-v4-address-plan`'>
+ <outcome value='AIC_DATA_PLANE_UNPROTECTED_V4'>
+ <block></block>
+ </outcome>
+ <outcome value='AIC_DATA_PLANE_PROTECTED_V4'>
+ <block></block>
+ </outcome>
+ <outcome value='AIC_DATA_PLANE_PRIVATE_V4'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Invalid address plan for SRIOV"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='Y'>
+ <block atomic='true'>
+ <switch test='`$network-model.eipam-v6-address-plan`'>
+ <outcome value="AIC_ATM_UNPROTECTED_V6">
+ <block></block>
+ </outcome>
+ <outcome value="AIC_ATM_PROTECTED_V6">
+ <block></block>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_UNPROTECTED_V6">
+ <block></block>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PRIVATE_V6">
+ <block></block>
+ </outcome>
+ <outcome value="AIC_DATA_PLANE_PROTECTED_V6">
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Invalid ipv6 address plan for SRIOV"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Invalid network-technology. Only AIC_SR_IOV and Contrail are supported for network automated flow"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.process-eipam-action' value='assign' />
+ </set>
+ <!--tmp.level should be set to 1-->
+ <call module='GENERIC-RESOURCE-API' rpc='process-eipam-pools' mode='sync' ></call>
+ <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.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Values after process-eipam"/>
+ <parameter name="field5" value="`level1-v4-mask`"/>
+ <parameter name="field6" value="`$tmp.l3-network.level1.v4.mask`"/>
+ <parameter name="field7" value="`level1-v4-ipprefix`"/>
+ <parameter name="field8" value="`$tmp.l3-network.level1.v4.ip-prefix`"/>
+ <parameter name="field9" value="`level1-v4-entity-id`"/>
+ <parameter name="field10" value="`$tmp.l3-network.level1.v4.entity-id`"/>
+ <parameter name="field11" value="`level2-v4-mask`"/>
+ <parameter name="field12" value="`$tmp.l3-network.level2.v4.mask`"/>
+ <parameter name="field13" value="`level2-v4-ipprefix`"/>
+ <parameter name="field14" value="`$tmp.l3-network.level2.v4.ip-prefix`"/>
+ <parameter name="field15" value="`level2-v4-entity-id`"/>
+ <parameter name="field16" value="`$tmp.l3-network.level2.v4.entity-id`"/>
+ </record>
+ <set>
+ <parameter name='v4.entity-id' value='`$tmp.l3-network.level2.v4.entity-id`' />
+ <parameter name='v4.ip-prefix' value='`$tmp.l3-network.level2.v4.ip-prefix`' />
+ <parameter name='v4.mask' value='`$tmp.l3-network.level2.v4.mask`' />
+ <parameter name='v6.entity-id' value='`$tmp.l3-network.level2.v6.entity-id`' />
+ <parameter name='v6.ip-prefix' value='`$tmp.l3-network.level2.v6.ip-prefix`' />
+ <parameter name='v6.mask' value='`$tmp.l3-network.level2.v6.mask`' />
+ </set>
+ <!--tmp.level should be set to 1-->
+ <call module='GENERIC-RESOURCE-API' rpc='create-l3-subnet' mode='sync' ></call>
+ <set>
+ <parameter name='tmp.network-topology.network-topology-identifier-structure.network-id' value="`$tmp.l3-network.network-name`" />
+ <parameter name='tmp.network-topology.network-topology-identifier-structure.network-name' value="`$tmp.l3-network.network-name`" />
+ <parameter name='tmp.network-topology.network-topology-identifier-structure.network-type' value="`$tmp.l3-network.network-type`" />
+ <parameter name='tmp.network-topology.network-topology-identifier-structure.network-role' value="`$tmp.l3-network.network-role`" />
+ <parameter name='tmp.network-topology.network-topology-identifier-structure.network-technology' value="`$tmp.l3-network.network-technology`" />
+ <parameter name='tmp.network-topology.network-topology-identifier-structure.eipam-v4-address-plan' value="`$network-model.eipam-v4-address-plan`" />
+ <parameter name='tmp.network-topology.network-topology-identifier-structure.eipam-v6-address-plan' value="`$network-model.eipam-v6-address-plan`" />
+ <parameter name='tmp.network-topology.region-identifier.tenant' value="`$network-topology-operation-input.network-request-input.tenant`" />
+ <parameter name='tmp.network-topology.region-identifier.aic-cloud-region' value="`$network-topology-operation-input.network-request-input.aic-cloud-region`" />
+ <parameter name='tmp.network-topology.region-identifier.aic-clli' value="`$network-topology-operation-input.network-request-input.aic-clli`" />
+ <parameter name='tmp.network-topology.onap-model-information.' value="`$network-topology-operation-input.network-information.onap-model-information.`" />
+ <parameter name='tmp.network-topology.network-parameters.' value="`$network-topology-operation-input.network-request-input.network-input-parameters.`" />
+ </set>
+ <switch test='`$tmp.l3-network.service-id`'>
+ <outcome value=''>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="network-name" value="`$tmp.l3-network.network-name`" />
+ <parameter name="network-type" value="`$tmp.l3-network.network-type`" />
+ <parameter name="network-role" value="`$tmp.l3-network.network-role`" />
+ <parameter name="network-technology" value="`$tmp.l3-network.network-technology`" />
+ <parameter name="is-bound-to-vpn" value="`$tmp.l3-network.is-bound-to-vpn-boolean`" />
+ <parameter name="tenant-id" value="`$network-topology-operation-input.network-request-information.tenant`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <parameter name="persona-model-id" value="`$tmp.l3-network.persona-model-id`" />
+ <parameter name="persona-model-version" value="`$tmp.l3-network.persona-model-version`" />
+ <parameter name="persona-model-customization-id" value="`$tmp.l3-network.persona-model-customization-id`" />
+ <parameter name="physical-network-name" value="`$tmp.l3-network.physical-network-name`" />
+ <parameter name="is-provider-network" value="`$tmp.l3-network.is-provider-network-boolean`" />
+ <parameter name="is-shared-network" value="`$tmp.l3-network.is-shared-network-boolean`" />
+ <parameter name="is-external-network" value="`$tmp.l3-network.is-external-network-boolean`" />
+ <parameter name="selflink" value="`$tmp.l3-network.self-link`" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="network-name" value="`$tmp.l3-network.network-name`" />
+ <parameter name="network-type" value="`$tmp.l3-network.network-type`" />
+ <parameter name="network-role" value="`$tmp.l3-network.network-role`" />
+ <parameter name="network-technology" value="`$tmp.l3-network.network-technology`" />
+ <parameter name="is-bound-to-vpn" value="`$tmp.l3-network.is-bound-to-vpn-boolean`" />
+ <parameter name="service-id" value="`$tmp.l3-network.service-id`" />
+ <parameter name="tenant-id" value="`$network-topology-operation-input.network-request-information.tenant`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <parameter name="persona-model-id" value="`$tmp.l3-network.persona-model-id`" />
+ <parameter name="persona-model-version" value="`$tmp.l3-network.persona-model-version`" />
+ <parameter name="persona-model-customization-id" value="`$tmp.l3-network.persona-model-customization-id`" />
+ <parameter name="physical-network-name" value="`$tmp.l3-network.physical-network-name`" />
+ <parameter name="is-provider-network" value="`$tmp.l3-network.is-provider-network-boolean`" />
+ <parameter name="is-shared-network" value="`$tmp.l3-network.is-shared-network-boolean`" />
+ <parameter name="is-external-network" value="`$tmp.l3-network.is-external-network-boolean`" />
+ <parameter name="selflink" value="`$tmp.l3-network.self-link`" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <for index='sidx' start='0' end='`$tmp.l3-network.subnet_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`"/>
+ </set>
+ <switch test='`$tmp.l3-network.subnet[$sidx].dhcp-enabled`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <switch test='`$tmp.l3-network.subnet[$sidx].gateway-address`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-start" value="`$tmp.l3-network.subnet[$sidx].dhcp-start`" />
+ <parameter name="dhcp-end" value="`$tmp.l3-network.subnet[$sidx].dhcp-end`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="gateway-address" value="`$tmp.l3-network.subnet[$sidx].gateway-address`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-start" value="`$tmp.l3-network.subnet[$sidx].dhcp-start`" />
+ <parameter name="dhcp-end" value="`$tmp.l3-network.subnet[$sidx].dhcp-end`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$tmp.l3-network.subnet[$sidx].gateway-address`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="gateway-address" value="`$tmp.l3-network.subnet[$sidx].gateway-address`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$hasVpnBindings`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <for index='vidx' start='0' end='`$vpn-bindings_length`' >
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="vpn-binding" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="vpn-binding.vpn-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$vpn-bindings[$vidx].binding-uuid`" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving vpn binding relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving vpn binding relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="service-instance" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="customer.global-customer-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$service-data.service-information.global-customer-id`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-key" value="service-subscription.service-type" />
+ <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-value" value="`$service-data.service-information.subscription-service-type`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-key" value="service-instance.service-instance-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-value" value="`$service-data.service-information.service-instance-id`" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving service instance relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving service instance relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.network-id"
+ force="true"
+ local-only="false">
+ <!-- create relationship-list -->
+ <parameter name="relationship-list.relationship[0].related-to" value="tenant" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="cloud-region.cloud-owner" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$prop.cloud-region.cloud-owner`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-key" value="cloud-region.cloud-region-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-value" value="`$network-topology-operation-input.network-request-input.aic-cloud-region`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-key" value="tenant.tenant-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-value" value="`$network-topology-operation-input.network-request-input.tenant`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="cloud-region" />
+ <parameter name="relationship-list.relationship[1].relationship-data[0].relationship-key" value="cloud-region.cloud-owner" />
+ <parameter name="relationship-list.relationship[1].relationship-data[0].relationship-value" value="`$prop.cloud-region.cloud-owner`" />
+ <parameter name="relationship-list.relationship[1].relationship-data[1].relationship-key" value="cloud-region.cloud-region-id" />
+ <parameter name="relationship-list.relationship[1].relationship-data[1].relationship-value" value="`$network-topology-operation-input.network-request-input.aic-cloud-region`" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving tenant and cloud-region relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving tenant and cloud-region relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <switch test='`$network-model.network-technology`'>
+ <outcome value='AIC_SR_IOV'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.l3-network.segmentation-id" value="1"/>
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="segmentation-assignment"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND segmentation-assignment.segmentation-id = $tmp.l3-network.segmentation-id" >
+ <!-- Create segmentation-assignment object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="segmentation-id" value="`$tmp.l3-network.segmentation-id`" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving segmentation-assignment for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving segmentation-assignment for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='network-topology.network-topology-identifier-structure.' value='`$tmp.l3-network.`' />
+ <parameter name='network-topology.tenant' value='`$network-topology-operation-input.network-request-input.tenant`' />
+ <parameter name='network-topology.onap-model-information.' value='`$network-topology-operation-input.network-information.onap-model-information.`' />
+ <parameter name='network-topology.network-parameters.' value='`$network-topology-operation-input.network-request-input.network-parameters.`' />
+ <parameter name='network-topology.aic-cloud-region' value='`$network-topology-operation-input.network-request-input.aic-cloud-region`' />
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$nidx].network-id" value='`$tmp.l3-network.network-id`' />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-topology." value='$network-topology.' />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-request-input." value='$x.' />
+ <parameter name="service-data.networks.network_length" value='`$nidx_len`' />
+ </set>
+ <set>
+ <parameter name='networkId' value='`$tmp.l3-network.network-id`' />
+ </set>
+ <set>
+ <parameter name='network-object-path'
+ value="`$tmp.l3-network.self-link`"/>
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.order-status' value='PendingCreate' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.last-rpc-action' value='`$network-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.last-action' value='`$network-topology-operation-input.request-information.request-action`' />
+ </set>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-assign-from-preload.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-assign-from-preload.xml
new file mode 100755
index 00000000..013219dd
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-assign-from-preload.xml
@@ -0,0 +1,952 @@
+<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='network-topology-operation-assign-from-preload' mode='sync'>
+ <block atomic="true">
+ <switch test="`$tmp.nidx`">
+ <outcome value=''>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='nidx' value='0' />
+ <parameter name='nidx_len' value='1'/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='nidx' value='`$service-data.networks.network_length`' />
+ <parameter name='nidx_len' value='`$service-data.networks.network_length + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='nidx' value='`$tmp.nidx`' />
+ <parameter name='nidx_len' value='`$service-data.networks.network_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.sdnc-request-header.' value='`$network-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.request-information.' value='`$network-topology-operation-input.request-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.service-information.' value='`$network-topology-operation-input.service-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-information.' value='`$network-topology-operation-input.network-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-request-input.' value='`$network-topology-operation-input.network-request-input.`' />
+ </set>
+ <set>
+ <parameter name='tmp.l3-network.model-invariant-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`" />
+ <parameter name='tmp.l3-network.model-version-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-version`" />
+ <parameter name='tmp.l3-network.model-customization-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`" />
+ <parameter name='s-onap-model-information.model-invariant-uuid' value='`$service-model.invariant-uuid`' />
+ <parameter name='s-onap-model-information.model-version' value='`$service-model.version`' />
+ <parameter name='s-onap-model-information.model-uuid' value='`$service-model.service-uuid`' />
+ <parameter name='s-onap-model-information.model-name' value='`$service-model.name`' />
+ <parameter name='n-onap-model-information.model-invariant-uuid' value='`$network-model.invariant-uuid`' />
+ <parameter name='n-onap-model-information.model-version' value='`$network-model.version`' />
+ <parameter name='n-onap-model-information.model-uuid' value='`$network-model.uuid`' />
+ <parameter name='n-onap-model-information.model-name' value='`$network-model.name`' />
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.service-information.ecomp-model-information.' value="`$s-onap-model-information.`" />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-information.ecomp-model-information.' value="`$n-onap-model-information.`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.preload-network`"/>
+ <parameter name="outputPath" value="tmp.pn-url"/>
+ <parameter name="target" value="{network-name}"/>
+ <parameter name="replacement" value="`$tmp.network-instance-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pn-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="preload-data" />
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="'Error: No preload-network found with network-name =' + $tmp.network-instance-name + ' in md-sal'" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/lmr-nto.log' />
+ </execute>
+ <set>
+ <parameter name="tmp.error-message" value=""/>
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-name = $tmp.network-instance-name"
+ local-only="false"
+ pfx="aai.l3-network">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="'Error searching for l3-network with network-name =' + $tmp.network-instance-name + 'from AnAI'" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="'Error l3-network with network-name =' + $tmp.network-instance-name + ' already exists in AnAI'" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.l3-network.network-name' value="`$tmp.network-instance-name`" />
+ <parameter name='tmp.l3-network.network-type' value="`$preload-data.preload-network-topology-information.network-topology-identifier-structure.network-type`" />
+ <parameter name="tmp.l3-network.physical-network-name" value="`$preload-data.preload-network-topology-information.physical-network-name`" />
+ <parameter name="tmp.l3-network.is-provider-network" value="`$preload-data.preload-network-topology-information.is-provider-network`" />
+ <parameter name="tmp.l3-network.is-shared-network" value="`$preload-data.preload-network-topology-information.is-shared-network`" />
+ <parameter name="tmp.l3-network.is-external-network" value="`$preload-data.preload-network-topology-information.network-topology-identifier-structure.network-type`" />
+ <parameter name='tmp.l3-network.network-role' value="`$preload-data.preload-network-topology-information.network-topology-identifier-structure.network-role`" />
+ <parameter name='tmp.l3-network.network-technology' value="`$preload-data.preload-network-topology-information.network-topology-identifier-structure.network-technology`" />
+ <parameter name='tmp.l3-network.is-bound-to-vpn' value="`$network-model.is-bound-to-vpn`" />
+ <parameter name="tmp.l3-network.tenant-id" value="`$network-topology-operation-input.network-request-input.tenant`" />
+ <parameter name="tmp.l3-network.network-role-instance" value="0" />
+ <parameter name='tmp.l3-network.orchestration-status' value="PendingCreate" />
+ <parameter name='tmp.l3-network.model-invariant-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`" />
+ <parameter name='tmp.l3-network.model-version-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-version`" />
+ <parameter name='tmp.l3-network.model-customization-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`" />
+ <parameter name='tmp.l3-network.eipam-v6-address-plan' value="`$network-model.eipam-v6-address-plan`" />
+ <parameter name='tmp.l3-network.eipam-v4-address-plan' value="`$network-model.eipam-v4-address-plan`" />
+ <parameter name='tmp.l3-network.service-id' value="`$service-data.service-information.service-id`" />
+ <parameter name='tmp.l3-network.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $service-data.service-information.service-instance-id
+ + '/service-data/networks/network/'
+ + $tmp.l3-network.network-id
+ + '/network-data/network-topology/'` " />
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$nidx].network-data.network-information.network-id" value='`$tmp.l3-network.network-id`' />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-information.from-preload" value='true' />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-information.network-type" value='`$tmp.l3-network.network-type`' />
+ </set>
+ <switch test='`$tmp.l3-network.service-id`'>
+ <outcome value=''>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="network-name" value="`$tmp.network-instance-name`" />
+ <parameter name='network-type' value="`$tmp.l3-network.network-type`" />
+ <parameter name='network-role' value="`$tmp.l3-network.network-role`" />
+ <parameter name='network-technology' value="`$network-model.network-technology`" />
+ <parameter name="is-bound-to-vpn" value="`$tmp.l3-network.is-bound-to-vpn-boolean`" />
+ <parameter name="tenant-id" value="`$network-topology-operation-input.network-request-input.tenant`" />
+ <parameter name="network-role-instance" value="0" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <parameter name="physical-network-name" value="`$preload-data.preload-network-topology-information.physical-network-name`" />
+ <parameter name="is-provider-network" value="`$preload-data.preload-network-topology-information.is-provider-network`" />
+ <parameter name="is-shared-network" value="`$preload-data.preload-network-topology-information.is-shared-network`" />
+ <parameter name="is-external-network" value="`$preload-data.preload-network-topology-information.is-external-network`" />
+ <parameter name="selflink" value="`$tmp.l3-network.self-link`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Failed to save l3-network in AnAI with network-id = ' + $tmp.return.generate-l3network-network-id.uuid`"/>
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Failed to save l3-network in AnAI with network-id = ' + $tmp.return.generate-l3network-network-id.uuid`"/>
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="network-name" value="`$tmp.network-instance-name`" />
+ <parameter name='network-type' value="`$network-model.network-type`" />
+ <parameter name='network-role' value="`$network-model.network-role`" />
+ <parameter name='network-technology' value="`$network-model.network-technology`" />
+ <parameter name='is-bound-to-vpn' value="`$network-model.is-bound-to-vpn`" />
+ <parameter name="service-id" value="`$network-topology-operation-input.service-information.service-id`" />
+ <parameter name="tenant-id" value="`$network-topology-operation-input.network-request-input.tenant`" />
+ <parameter name="network-role-instance" value="0" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <parameter name="physical-network-name" value="`$preload-data.preload-network-topology-information.physical-network-name`" />
+ <parameter name="is-provider-network" value="`$preload-data.preload-network-topology-information.is-provider-network`" />
+ <parameter name="is-shared-network" value="`$preload-data.preload-network-topology-information.is-shared-network`" />
+ <parameter name="is-external-network" value="`$preload-data.preload-network-topology-information.is-external-network`" />
+ <parameter name="selflink" value="`$tmp.l3-network.self-link`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Failed to save l3-network in AnAI with network-id = ' + $tmp.return.generate-l3network-network-id.uuid`"/>
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Failed to save l3-network in AnAI with network-id = ' + $tmp.return.generate-l3network-network-id.uuid`"/>
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <switch test="`$preload-data.preload-network-topology-information.subnets_length`">
+ <outcome value=''>
+ <set>
+ <parameter name="preload-data.preload-network-topology-information.subnets_length" value="0" />
+ </set>
+ </outcome>
+ </switch>
+ <for index="i" start="0" end="`$preload-data.preload-network-topology-information.subnets_length`">
+ <block atomic='true'>
+ <switch test="`$preload-data.preload-network-topology-information.subnets[$i].dhcp-enabled`">
+ <outcome value='Y'>
+ <set>
+ <parameter name="tmp.dhcpEnabled.boolean" value="true" />
+ </set>
+ </outcome>
+ <outcome value='N'>
+ <set>
+ <parameter name="tmp.dhcpEnabled.boolean" value="false" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$preload-data.preload-network-topology-information.subnets[$i].addr-from-start`">
+ <outcome value='Y'>
+ <set>
+ <parameter name="tmp.addrFromStart.boolean" value="true" />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <set>
+ <parameter name="tmp.addrFromStart.boolean" value="true" />
+ </set>
+ </outcome>
+ <outcome value='N'>
+ <set>
+ <parameter name="tmp.addrFromStart.boolean" value="false" />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.gateway-address" value="`$preload-data.preload-network-topology-information.subnets[$i].gateway-address`" />
+ </set>
+ <switch test="`$preload-data.preload-network-topology-information.subnets[$i].gateway-address`">
+ <outcome value=''>
+ <block atomic='true'>
+ <execute plugin="com.att.sdnctl.sli.plugin.ipAddressTools.IpAddressTool" method="getGatewayAddress">
+ <parameter name="ipAddress" value="`$preload-data.preload-network-topology-information.subnets[$i].start-address`" />
+ <parameter name="ipVersion" value="`$preload-data.preload-network-topology-information.subnets[$i].ip-version`" />
+ <parameter name="subnet" value="`$preload-data.preload-network-topology-information.subnets[$i].cidr-mask`" />
+ <parameter name="ctxVariable" value="tmp.return.generate.gateway-address" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name="tmp.gateway-address" value="`$tmp.return.generate.gateway-address`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.local.network-id" value="`$tmp.l3-network.network-id`" />
+ </set>
+ <call module="VNF-API" rpc="generate-subnets-subnet-id" mode="sync" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </outcome>
+ </call>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.return.generate-subnets-subnet-id.uuid" >
+ <!-- Create subnet object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.return.generate-subnets-subnet-id.uuid`" />
+ <parameter name="subnet-name" value="`$preload-data.preload-network-topology-information.subnets[$i].subnet-name`" />
+ <parameter name="subnet-role" value="`$preload-data.preload-network-topology-information.subnets[$i].subnet-role`" />
+ <parameter name="gateway-address" value="`$tmp.gateway-address`" />
+ <parameter name="network-start-address" value="`$preload-data.preload-network-topology-information.subnets[$i].start-address`" />
+ <parameter name="cidr-mask" value="`$preload-data.preload-network-topology-information.subnets[$i].cidr-mask`" />
+ <parameter name="ip-version" value="`$preload-data.preload-network-topology-information.subnets[$i].ip-version`" />
+ <parameter name="dhcp-start" value="`$preload-data.preload-network-topology-information.subnets[$i].dhcp-start-address`" />
+ <parameter name="dhcp-end" value="`$preload-data.preload-network-topology-information.subnets[$i].dhcp-end-address`" />
+ <parameter name="dhcp-enabled" value="`$tmp.dhcpEnabled.boolean`" />
+ <parameter name="ip-assignment-direction" value="`$tmp.addrFromStart.boolean`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet in AnAI where subnet-id = ' + $tmp.return.generate-subnets-subnet-id.uuid`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet in AnAI where subnet-id = ' + $tmp.return.generate-subnets-subnet-id.uuid`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <switch test='`$preload-data.preload-network-topology-information.host-routes_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='preload-data.preload-network-topology-information.host-routes_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index="h" start="0" end="`$preload-data.preload-network-topology-information.host-routes_length`">
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.local.subnet-id" value="`$tmp.return.generate-subnets-subnet-id.uuid`" />
+ </set>
+ <call module="GENERIC-RESOURCE-API" rpc="generate-host-routes-host-route-id" mode="sync" >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </outcome>
+ </call>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="host-route"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.return.generate-subnets-subnet-id.uuid
+ AND host-route.host-route-id = $tmp.return.generate-host-routes-host-route-id.uuid" >
+ <!-- Create host-route object -->
+ <parameter name="host-route-id" value="`$tmp.return.generate-host-routes-host-route-id.uuid`" />
+ <parameter name="route-prefix" value="`$preload-data.preload-network-topology-information.subnets[$i].host-routes[$h].route-prefix`" />
+ <parameter name="next-hop" value="`$preload-data.preload-network-topology-information.subnets[$i].host-routes[$h].next-hop`" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving host-route in AnAI where host-route-id = ' + $tmp.return.generate-host-routes-host-route-id.uuid`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving host-route in AnAI where host-route-id = ' + $tmp.return.generate-host-routes-host-route-id.uuid`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ </block>
+ </for>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.network-id"
+ force="true"
+ local-only="false">
+ <!-- create relationship-list -->
+ <parameter name="relationship-list.relationship[0].related-to" value="tenant" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="cloud-region.cloud-owner" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$prop.cloud-region.cloud-owner`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-key" value="cloud-region.cloud-region-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-value" value="`$network-topology-operation-input.network-request-input.aic-cloud-region`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-key" value="tenant.tenant-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-value" value="`$network-topology-operation-input.network-request-input.tenant`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="cloud-region" />
+ <parameter name="relationship-list.relationship[1].relationship-data[0].relationship-key" value="cloud-region.cloud-owner" />
+ <parameter name="relationship-list.relationship[1].relationship-data[0].relationship-value" value="`$prop.cloud-region.cloud-owner`" />
+ <parameter name="relationship-list.relationship[1].relationship-data[1].relationship-key" value="cloud-region.cloud-region-id" />
+ <parameter name="relationship-list.relationship[1].relationship-data[1].relationship-value" value="`$network-topology-operation-input.network-request-input.aic-cloud-region`" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving tenant and cloud-region relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving tenant and cloud-region relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <switch test="`$preload-data.preload-network-topology-information.vpn-bindings_length`">
+ <outcome value=''>
+ <set>
+ <parameter name="preload-data.preload-network-topology-information.vpn-bindings_length" value="0" />
+ </set>
+ </outcome>
+ </switch>
+ <for index="i" start="0" end="`$preload-data.preload-network-topology-information.vpn-bindings_length`">
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.vpn-binding-id" value="" />
+ </set>
+ <switch test="`$preload-data.preload-network-topology-information.vpn-bindings[$i].vpn-binding-id`">
+ <outcome value='Other'>
+ <set>
+ <parameter name="tmp.vpn-binding-id" value="`$preload-data.preload-network-topology-information.vpn-bindings[$i].vpn-binding-id`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.vpn-binding-id != ''`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-binding.vpn-id = $tmp.vpn-binding-id"
+ local-only="false"
+ pfx="tmp.AnAI.vpn-binding">
+ <outcome value='success'>
+ <switch test="`$tmp.AnAI.vpn-binding.vpn-id`" >
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query vpn-bindings from AnAI where vpn-binding-id = ' + $tmp.vpn-binding-id + '.'`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query vpn-bindings from AnAI where vpn-binding-id = ' + $preload-data.preload-network-topology-information.vpn-bindings[$i].vpn-binding-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query vpn-bindings from AnAI where vpn-binding-id = ' + $preload-data.preload-network-topology-information.vpn-bindings[$i].vpn-binding-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.network-id"
+ force="true"
+ local-only="false">
+ <parameter name="relationship-list.relationship[0].related-to" value="vpn-binding" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="vpn-binding.vpn-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.vpn-binding-id`" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving vpn-binding relationship for l3-network in AnAI where vpn-id = ' + $tmp.vpn-binding-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving vpn-binding relationship for l3-network in AnAI where vpn-id = ' + $tmp.vpn-binding-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name="tmp.is-bound-to-vpn" value="true" />
+ </set>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$preload-data.preload-network-topology-information.network-policy_length`">
+ <outcome value=''>
+ <set>
+ <parameter name='preload-data.preload-network-topology-information.network-policy_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index="i" start="0" end="`$preload-data.preload-network-topology-information.network-policy_length`">
+ <switch test="`$preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn != ''`">
+ <outcome value='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-fqdn = $preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn"
+ local-only="false"
+ pfx="tmp.AnAI.network-policy">
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query network-policy n AnAI where network-policy-fqdn = ' + $preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query network-policy n AnAI where network-policy-fqdn = ' + $preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <switch test="`$tmp.AnAI.network-policy.network-policy-id`" >
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query newtork-policy from AnAI where network-policy-fqdn = ' + $preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn + '. It is likely that the same network-policy-fqdn points to more than one network-policy objects in AnAI.'`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="network-policy" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="network-policy.network-policy-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.AnAI.network-policy.network-policy-id`" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving network-policy relationship for l3-network in AnAI where network-policy-id = ' + $tmp.AnAI.network-policy.network-policy-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving network-policy relationship for l3-network in AnAI where network-policy-id = ' + $tmp.AnAI.network-policy.network-policy-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$preload-data.preload-network-topology-information.route-table-reference_length`">
+ <outcome value=''>
+ <set>
+ <parameter name='preload-data.preload-network-topology-information.route-table-reference_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index="i" start="0" end="`$preload-data.preload-network-topology-information.route-table-reference_length`">
+ <switch test="`$preload-data.preload-network-topology-information.route-table-reference[$i].route-table-reference-fqdn != ''`">
+ <outcome value='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="route-table-reference"
+ key="route-table-reference.route-table-reference-fqdn = $preload-data.preload-network-topology-information.route-table-reference[$i].route-table-reference-fqdn"
+ pfx="tmp.AnAI.route-table-reference">
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query network-policy n AnAI where network-policy-fqdn = ' + $preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query network-policy n AnAI where network-policy-fqdn = ' + $preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <switch test="`$tmp.AnAI.route-table-reference.route-table-reference-id`" >
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query route-table-reference from AnAI where route-table-reference-fqdn = ' + $preload-data.preload-network-topology-information.route-table-reference[$i].route-table-reference-fqdn + '. It is likely that the same route-table-reference-fqdn points to more than one route-table-reference objects in AnAI.'`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="route-table-reference" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="route-table-reference.route-table-reference-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.AnAI.route-table-reference.route-table-reference-id`" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving route-table-reference relationship for l3-network in AnAI where route-table-reference-id = ' + $tmp.AnAI.route-table-reference.route-table-reference-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving route-table-reference relationship for l3-network in AnAI where route-table-reference-id = ' + $tmp.AnAI.route-table-reference.route-table-reference-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.is-bound-to-vpn`">
+ <outcome value="true">
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <parameter name="is-bound-to-vpn" value="true" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while updating l3-network is-bound-to-vpn in AnAI where network-id = ' + $tmp.return.generate-l3network-network-id.uuid`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while updating l3-network is-bound-to-vpn in AnAI where network-id = ' + $tmp.return.generate-l3network-network-id.uuid`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </update>
+ </outcome>
+ </switch>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="service-instance" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="customer.global-customer-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$service-data.service-information.global-customer-id`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-key" value="service-subscription.service-type" />
+ <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-value" value="`$service-data.service-information.subscription-service-type`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-key" value="service-instance.service-instance-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-value" value="`$service-data.service-information.service-instance-id`" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving service-instance relationship for l3-network in AnAI where service-instance-id = ' + $network-topology-operation-input.service-information.service-instance-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving service-instance relationship for l3-network in AnAI where service-instance-id = ' + $network-topology-operation-input.service-information.service-instance-id`"/>
+ </set>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/>
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='network-topology.network-topology-identifier-structure.' value='`$tmp.l3-network.`' />
+ <parameter name='network-topology.tenant' value='`$network-topology-operation-input.network-request-input.tenant`' />
+ <parameter name='network-topology.onap-model-information.' value='`$network-topology-operation-input.network-information.onap-model-information.`' />
+ <parameter name='network-topology.network-parameters.' value='`$network-topology-operation-input.network-request-input.network-parameters.`' />
+ <parameter name='network-topology.aic-cloud-region' value='`$network-topology-operation-input.network-request-input.aic-cloud-region`' />
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$nidx].network-id" value='`$tmp.l3-network.network-id`' />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-information.from-preload" value='true' />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-topology." value='$network-topology.' />
+ <parameter name="service-data.networks.network_length" value='`$nidx_len`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/lmr-nto2.log' />
+ </execute>
+ <set>
+ <parameter name='networkId' value='`$tmp.l3-network.network-id`' />
+ </set>
+ <set>
+ <parameter name='network-object-path'
+ value="`$tmp.l3-network.self-link`"/>
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.order-status' value='PendingCreate' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.last-rpc-action' value='`$network-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.last-action' value='`$network-topology-operation-input.request-information.request-action`' />
+ </set>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-assign-vlantagging-instancegroup.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-assign-vlantagging-instancegroup.xml
new file mode 100755
index 00000000..56c9f6a5
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-assign-vlantagging-instancegroup.xml
@@ -0,0 +1,1097 @@
+<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='network-topology-operation-assign-vlantagging-instancegroup' mode='sync'>
+ <block atomic="true">
+ <switch test="`$tmp.nidx`">
+ <outcome value=''>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='nidx' value='0' />
+ <parameter name='nidx_len' value='1'/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='nidx' value='`$service-data.networks.network_length`' />
+ <parameter name='nidx_len' value='`$service-data.networks.network_length + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='nidx' value='`$tmp.nidx`' />
+ <parameter name='nidx_len' value='`$service-data.networks.network_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.ngidx`">
+ <outcome value=''>
+ <switch test='`$service-data.network-instance-groups.network-instance-group_len`'>
+ <outcome value=''>
+ <set>
+ <parameter name='ngidx' value='0' />
+ <parameter name='ngidx_len' value='1'/>
+ <parameter name="ngnidx" value='0' />
+ <parameter name="nig.preexists" value="false"/>
+ <parameter name="nig.first-network" value="true"/>
+ <parameter name="nig.networks.network_len" value="1" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='ngidx' value='`$service-data.network-instance-groups.network-instance-group_length`' />
+ <parameter name='ngidx_len' value='`$service-data.network-instance-groups.network-instance-group_length + 1`' />
+ <parameter name="nig.preexists" value="false"/>
+ <parameter name="ngnidx" value='0' />
+ <parameter name="nig.first-network" value="true"/>
+ <parameter name="nig.networks.network_len" value="1" />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='ngidx' value='`$tmp.ngidx`' />
+ <parameter name='ngidx_len' value='`$service-data.network-instance-groups.network-instance-group_length`' />
+ <parameter name="nig.preexists" value="false"/>
+ </set>
+ <switch test='`$ctx.network-instance-group-data.networks.network_len`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="nig.first-network" value="true" />
+ <parameter name="ngnidx" value="0" />
+ <parameter name="nig.networks.network_len" value="1" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block atomic='true'>
+ <set>
+ <parameter name="nig.first-network" value="true" />
+ <parameter name="ngnidx" value="0" />
+ <parameter name="nig.networks.network_len" value="1" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name="nig." value="`$ctx.network-instance-group-data.`" />
+ </set>
+ <set>
+ <parameter name="nig.first-network" value="false" />
+ <parameter name="ngnidx" value="`$ctx.network-instance-group-data.networks.network_length`" />
+ <parameter name="nig.networks.network_len" value="`$ctx.network-instance-group-data.networks.network_length + 1`" />
+ <parameter name="nig." value="`$ctx.network-instance-group-data.`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.error-message" value=""/>
+ <parameter name="tmp.l3-network.network-instance-group-id" value="`$network-topology-operation-input.network-request-input.network-instance-group-id`" />
+ <parameter name='tmp.l3-network.network-type' value="`$network-model.network-type`" />
+ <parameter name='tmp.l3-network.network-role' value="`$network-model.network-role`" />
+ <parameter name='tmp.l3-network.network-technology' value="`$network-model.network-technology`" />
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.sdnc-request-header.' value='`$network-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.request-information.' value='`$network-topology-operation-input.request-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.service-information.' value='`$network-topology-operation-input.service-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-information.' value='`$network-topology-operation-input.network-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-request-input.' value='`$network-topology-operation-input.network-request-input.`' />
+ <parameter name='service-data.networks.network[$nidx].network-id' value='`$tmp.l3-network.network-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.l3-network.model-invariant-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`" />
+ <parameter name='tmp.l3-network.model-version-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-version`" />
+ <parameter name='tmp.l3-network.model-customization-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`" />
+ <parameter name='s-onap-model-information.model-invariant-uuid' value='`$service-model.invariant-uuid`' />
+ <parameter name='s-onap-model-information.model-version' value='`$service-model.version`' />
+ <parameter name='s-onap-model-information.model-uuid' value='`$service-model.service-uuid`' />
+ <parameter name='s-onap-model-information.model-name' value='`$service-model.name`' />
+ <parameter name='n-onap-model-information.model-invariant-uuid' value='`$network-model.invariant-uuid`' />
+ <parameter name='n-onap-model-information.model-version' value='`$network-model.version`' />
+ <parameter name='n-onap-model-information.model-uuid' value='`$network-model.uuid`' />
+ <parameter name='n-onap-model-information.model-name' value='`$network-model.name`' />
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$nidx]..network-data.service-information.onap-model-information.' value="`$s-onap-model-information.`" />
+ <parameter name='service-data.networks.network[$nidx]..network-data.network-information.onap-model-information.' value="`$n-onap-model-information.`" />
+ </set>
+ <set>
+ <parameter name='tmp.l3-network.network-type' value="`$network-model.network-type`" />
+ <parameter name='tmp.l3-network.network-role' value="`$network-model.network-role`" />
+ <parameter name='tmp.l3-network.network-technology' value="`$network-model.network-technology`" />
+ <parameter name='tmp.l3-network.is-bound-to-vpn' value="`$network-model.is-bound-to-vpn`" />
+ <parameter name='tmp.l3-network.orchestration-status' value="PendingCreate" />
+ <parameter name='tmp.l3-network.model-invariant-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`" />
+ <parameter name='tmp.l3-network.model-version-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-version`" />
+ <parameter name='tmp.l3-network.model-customization-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`" />
+ <parameter name='tmp.l3-network.is-provider-network' value="`$network-model.is-provider-network`" />
+ <parameter name='tmp.l3-network.is-shared-network' value="`$network-model.is-shared-network`" />
+ <parameter name='tmp.l3-network.is-external-network' value="`$network-model.is-external-network`" />
+ <parameter name='tmp.l3-network.eipam-v6-address-plan' value="`$network-model.eipam-v6-address-plan`" />
+ <parameter name='tmp.l3-network.eipam-v4-address-plan' value="`$network-model.eipam-v4-address-plan`" />
+ <parameter name='tmp.l3-network.service-id' value="`$service-data.service-information.service-id`" />
+ <parameter name='tmp.l3-network.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $network-topology-operation-input.service-information.service-instance-id
+ + '/service-data/networks/network/'
+ + $tmp.l3-network.network-id
+ + '/network-data/network-topology/'` " />
+ </set>
+ <switch test='`$network-model.is-provider-network`'>
+ <outcome value='Y'>
+ <set>
+ <parameter name='tmp.l3-network.physical-network-name' value="`$network-model.physical-network-name`" />
+ <parameter name='tmp.l3-network.is-provider-network-boolean' value='true' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.l3-network.physical-network-name' value="" />
+ <parameter name='tmp.l3-network.is-provider-network-boolean' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$network-model.is-shared-network`'>
+ <outcome value='Y'>
+ <set>
+ <parameter name='tmp.l3-network.is-shared-network-boolean' value='true' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.l3-network.is-shared-network-boolean' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$network-model.is-external-network`'>
+ <outcome value='Y'>
+ <set>
+ <parameter name='tmp.l3-network.is-external-network-boolean' value='true' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.l3-network.is-external-network-boolean' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$network-model.is-bound-to-vpn`'>
+ <outcome value='Y'>
+ <set>
+ <parameter name='tmp.l3-network.is-bound-to-vpn-boolean' value='true' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.l3-network.is-bound-to-vpn-boolean' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id"
+ local-only="false"
+ pfx="aai.l3-network">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="'Error searching for l3-network with network-id =' + $tmp.l3-network.network-id + 'from AnAI. Network should be created by MSO'" />
+ </return>
+ </outcome>
+ <outcome value='not-found'></outcome>
+ </get-resource>
+ <set>
+ <parameter name='aaiapi.input.network-instance-group-id' value="`$tmp.l3-network.network-instance-group-id`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='aai-get-network-instance-group' mode='sync' ></call>
+ <set>
+ <parameter name="get-complex-resource-service-model-input.customization-uuid" value="`$aaiapi.output.collection-customization-uuid`"/>
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='get-complex-resource-service-model' mode='sync' ></call>
+ <set>
+ <parameter name="nig.network-instance-group-id" value="`$tmp.l3-network.network-instance-group-id`"/>
+ <parameter name="nig.network-instance-group-function" value="`$aaiapi.output.collection-function`"/>
+ <parameter name="nig.service-instance-id" value="`$network-topology-operation-input.service-information.service-instance-id`"/>
+ </set>
+ <set>
+ <parameter name='nig.networks.network[$ngnidx].network-id' value="`$tmp.l3-network.network-id`" />
+ </set>
+ <set>
+ <parameter name="get-data-from-policy-input.policy-instance-name" value="`$get-complex-resource-service-model-output.subnet-assignment-policy`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='get-data-from-policy' mode='sync' ></call>
+ <set>
+ <parameter name="nig.subnet-assignment-policy.subnet-use" value="`$get-data-from-policy-output.ip-assignment`" />
+ </set>
+ <set>
+ <parameter name='naming-policy-generate-name-input.policy-instance-name' value='`$get-complex-resource-service-model-output.network-naming-policy`' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='ASSIGN' />
+ <parameter name='naming-policy-generate-name-input.query-parameter' value='`$network-model.customization-uuid`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <set>
+ <parameter name='tmp.l3-network.network-name' value='`$naming-policy-generate-name-output.network-name`' />
+ </set>
+ <set>
+ <parameter name='network-topology.network-topology-identifier-structure.network-id' value="`$tmp.l3-network.network-id`" />
+ <parameter name='network-topology.network-topology-identifier-structure.network-name' value="`$tmp.l3-network.network-name`" />
+ <parameter name='network-topology.network-topology-identifier-structure.network-instance-group-id' value="`$tmp.l3-network.network-instance-group-id`" />
+ <parameter name='network-topology.network-topology-identifier-structure.network-type' value="`$tmp.l3-network.network-type`" />
+ <parameter name='network-topology.network-topology-identifier-structure.network-role' value="`$tmp.l3-network.network-role`" />
+ <parameter name='network-topology.network-topology-identifier-structure.network-technology' value="`$tmp.l3-network.network-technology`" />
+ <parameter name='network-topology.region-identifier.tenant' value="`$network-topology-operation-input.network-request-input.tenant`" />
+ <parameter name='network-topology.region-identifier.aic-cloud-region' value="`$network-topology-operation-input.network-request-input.aic-cloud-region`" />
+ <parameter name='network-topology.region-identifier.aic-clli' value="`$network-topology-operation-input.network-request-input.aic-clli`" />
+ <parameter name='network-topology.onap-model-information.' value="`$network-topology-operation-input.network-information.onap-model-information.`" />
+ <parameter name='network-topology.network-parameters.' value="`$network-topology-operation-input.network-request-input.network-input-parameters.`" />
+ <parameter name='nig.network.network-id' value="`$tmp.l3-network.network-id`" />
+ </set>
+ <set>
+ <parameter name="aaiapi.input.cloud-owner" value="`$prop.cloud-region.cloud-owner`" />
+ <parameter name="aaiapi.input.cloud-region-id" value="`$network-topology-operation-input.network-request-input.aic-cloud-region`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='aai-get-aic-zone' mode='sync' ></call>
+ <set>
+ <parameter name='network-topology.region-identifier.aic-clli' value="`$aaiapi.output.aic-clli`" />
+ </set>
+ <set>
+ <parameter name="nig.cloud-zone" value="`$aaiapi.output.cloud-zone`" />
+ <parameter name="rt.aic-zone" value="`$aaiapi.output.cloud-zone`" />
+ <parameter name="rt.resource" value="NetworkID" />
+ <parameter name="rt.resource-value" value="`$tmp.l3-network.network-id`" />
+ <parameter name="rt.network-name" value="`$tmp.l3-network.network-name`" />
+ <parameter name="rt.service-instance-id" value="`$network-topology-operation-input.service-information.service-instance-id`" />
+ <parameter name="rt.network-instance-group-id" value="`$tmp.l3-network.network-instance-group-id`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='create-route-target-and-vpn-binding' mode='sync' ></call>
+ <set>
+ <parameter name='nig.vpn-bindings.id' value="`$vpn-binding.vpn-binding-id`" />
+ <parameter name='nig.vpn-bindings.global-route-target' value="`$vpn-binding.global-route-target`" />
+ <parameter name='nig.vpn-bindings.aic-zone' value="`$aaiapi.output.cloud-zone`" />
+ <parameter name='nig.vpn-bindings.route-target-role' value="`$vpn-binding.route-target-role`" />
+ </set>
+ <switch test='`$nig.subnet-assignment-policy.subnet-use`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="Subnet use not set"/>
+ </set>
+ <switch test='`$tmp.nig-preexists`'>
+ <outcome value='true'>
+ <block atomic='true'></block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.nig-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-nig" />
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='unique'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.skip-first-level" value="Y"/>
+ <parameter name="tmp.allocate-subnet-flag" value="Y"/>
+ <parameter name="generate-FQPN-input.aic-cloud-region" value="`$aai.cloud-region.cloud-region-id`" />
+ <parameter name="generate-FQPN-input.network-name" value="`$network-topology.network-topology-identifier-structure.network-name`" />
+ <parameter name="generate-FQPN-input.network-role" value="`$network-topology.network-topology-identifier-structure.network-role`" />
+ <parameter name="generate-FQPN-input.network-collection" value="`$aaiapi.output.collection-name`" />
+ <parameter name="generate-FQPN-input.network-id" value="`$network-topology.network-topology-identifier-structure.network-id`" />
+ <parameter name="tmp.network-id" value="`network-topology.network-topology-identifier-structure.network-id`" />
+ <parameter name="tmp.network-instance-group-id" value="`$network-topology.network-topology-identifier-structure.network-instance-group-id`" />
+ <!-- the following are not set by calling dg
+generate-FQPN-input.subnet-role
+generate-FQPN-input.zone
+generate-FQPN-input.equipment
+-->
+ <!-- network model is already in contect memory -->
+ <!-- aai.cloud-region.cloud-region-id is already in contect memory -->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='process-generic-eipam-pools' 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="`'Error from process-generic-eipam-pools, ' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <switch test="`$network-model.eipam-v4-address-plan != ''`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="network-topology.network-identifier-structure.eipam-v4-address-plan" value="`$network-model.eipam-v4-address-plan`" />
+ </set>
+ <for silentFailure='true' index='eidx' start='0' end='`$eipam-ip-block.createPoolResponse.CreatePoolPlans_length`' >
+ <switch test="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.PlanName == $network-model.eipam-v4-address-plan`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="v4.ip-prefix" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.IPAddress`"/>
+ <parameter name="v4.mask" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.Mask`"/>
+ <parameter name="v4.entity-id" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.IpamPoolAllocId`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.eipam-v6-address-plan != ''`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="network-topology.network-identifier-structure.eipam-v6-address-plan" value="`$network-model.eipam-v4-address-plan`" />
+ </set>
+ <for silentFailure='true' index='eidx' start='0' end='`$eipam-ip-block.createPoolResponse.CreatePoolPlans_length`' >
+ <switch test="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.PlanName == $network-model.eipam-v6-address-plan`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="v6.ip-prefix" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.IPAddress`"/>
+ <parameter name="v6.mask" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.Mask`"/>
+ <parameter name="v6.entity-id" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.IpamPoolAllocId`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <!--tmp.level should be set to 1-->
+ <call module='GENERIC-RESOURCE-API' rpc='create-l3-subnet' mode='sync' ></call>
+ <switch test='`$tmp.l3-network.service-id`'>
+ <outcome value=''>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="network-name" value="`$tmp.l3-network.network-name`" />
+ <parameter name="network-type" value="`$network-model.network-type`" />
+ <parameter name="network-role" value="`$network-model.network-role`" />
+ <parameter name="network-technology" value="`$network-model.network-technology`" />
+ <parameter name="is-bound-to-vpn" value="`$tmp.l3-network.is-bound-to-vpn-boolean`" />
+ <parameter name="tenant-id" value="`$network-topology-operation-input.network-request-information.tenant`" />
+ <parameter name="model-invariant-id" value="`$network-model.invariant_uuid`" />
+ <parameter name="model-version" value="`$network-model.version`" />
+ <parameter name="model-customization-id" value="`$network-model.customization-id`" />
+ <parameter name="physical-network-name" value="`$network-model.physical-network-name`" />
+ <parameter name="is-provider-network" value="`$tmp.l3-network.is-provider-network-boolean`" />
+ <parameter name="is-shared-network" value="`$tmp.l3-network.is-shared-network-boolean`" />
+ <parameter name="is-external-network" value="`$tmp.l3-network.is-external-network-boolean`" />
+ <parameter name="selflink" value="`$tmp.l3-network.self-link`" />
+ <parameter name="operational-status" value="out-of-service-path" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`" />
+ </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="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`" />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="network-name" value="`$tmp.l3-network.network-name`" />
+ <parameter name="network-type" value="`$network-model.network-type`" />
+ <parameter name="network-role" value="`$network-model.network-role`" />
+ <parameter name="network-technology" value="`$network-model.network-technology`" />
+ <parameter name="is-bound-to-vpn" value="`$tmp.l3-network.is-bound-to-vpn-boolean`" />
+ <parameter name="tenant-id" value="`$network-topology-operation-input.network-request-information.tenant`" />
+ <parameter name="model-invariant-id" value="`$network-model.invariant_uuid`" />
+ <parameter name="model-version" value="`$network-model.version`" />
+ <parameter name="model-customization-id" value="`$network-model.customization-id`" />
+ <parameter name="physical-network-name" value="`$network-model.physical-network-name`" />
+ <parameter name="is-provider-network" value="`$tmp.l3-network.is-provider-network-boolean`" />
+ <parameter name="is-shared-network" value="`$tmp.l3-network.is-shared-network-boolean`" />
+ <parameter name="is-external-network" value="`$tmp.l3-network.is-external-network-boolean`" />
+ <parameter name="selflink" value="`$tmp.l3-network.self-link`" />
+ <parameter name="service-id" value="`$tmp.l3-network.service-id`" />
+ <parameter name="operational-status" value="out-of-service-path" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`" />
+ </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="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`" />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="msidx" value="`$nig.subnets_length`" />
+ </set>
+ <for index='sidx' start='0' end='`$tmp.l3-network.subnet_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`"/>
+ </set>
+ <switch test='`$tmp.l3-network.subnet[$sidx].dhcp-enabled`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <switch test='`$tmp.l3-network.subnet[$sidx].gateway-address`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-start" value="`$tmp.l3-network.subnet[$sidx].dhcp-start`" />
+ <parameter name="dhcp-end" value="`$tmp.l3-network.subnet[$sidx].dhcp-end`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="gateway-address" value="`$tmp.l3-network.subnet[$sidx].gateway-address`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-start" value="`$tmp.l3-network.subnet[$sidx].dhcp-start`" />
+ <parameter name="dhcp-end" value="`$tmp.l3-network.subnet[$sidx].dhcp-end`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$tmp.l3-network.subnet[$sidx].gateway-address`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="gateway-address" value="`$tmp.l3-network.subnet[$sidx].gateway-address`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="nig.subnets[$msidx].start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="nig.subnets[$msidx].subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="nig.subnets[$msidx].subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="nig.subnets[$msidx].gateway-address" value="`$tmp.l3-network.subnet[$sidx].gateway-address`" />
+ <parameter name="nig.subnets[$msidx].cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="nig.subnets[$msidx].ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="nig.subnets[$msidx].dhcp-start-address" value="`$tmp.l3-network.subnet[$sidx].dhcp-start`" />
+ <parameter name="nig.subnets[$msidx].dhcp-end-address" value="`$tmp.l3-network.subnet[$sidx].dhcp-end`" />
+ <parameter name="nig.subnets[$msidx].dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ </set>
+ <set>
+ <parameter name="msidx" value="`$msidx + 1`" />
+ <parameter name="nig.subnets_length" value="`$nig.subnets_length + 1`" />
+ </set>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='shared'>
+ <block atomic="true">
+ <switch test='`$tmp.first-network`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.skip-first-level" value="Y"/>
+ <parameter name="tmp.allocate-subnet-flag" value="Y"/>
+ <parameter name="generate-FQPN-input.aic-cloud-region" value="`$aai.cloud-region.cloud-region-id`" />
+ <parameter name="generate-FQPN-input.network-name" value="`$network-topology.network-topology-identifier-structure.network-name`" />
+ <parameter name="generate-FQPN-input.network-role" value="`$network-topology.network-topology-identifier-structure.network-role`" />
+ <parameter name="generate-FQPN-input.network-collection" value="`$aaiapi.output.collection-name`" />
+ <parameter name="generate-FQPN-input.network-id" value="`$network-topology.network-topology-identifier-structure.network-id`" />
+ <parameter name="tmp.network-id" value="`network-topology.network-topology-identifier-structure.network-id`" />
+ <parameter name="tmp.network-instance-group-id" value="`$network-topology.network-topology-identifier-structure.network-instance-group-id`" />
+ <!-- the following are not set by calling dg
+generate-FQPN-input.subnet-role
+generate-FQPN-input.zone
+generate-FQPN-input.equipment
+-->
+ <!-- network model is already in contect memory -->
+ <!-- aai.cloud-region.cloud-region-id is already in contect memory -->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='process-generic-eipam-pools' 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="`'Error from process-generic-eipam-pools, ' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <switch test="`$network-model.eipam-v4-address-plan != ''`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="network-topology.network-identifier-structure.eipam-v4-address-plan" value="`$network-model.eipam-v4-address-plan`" />
+ </set>
+ <for silentFailure='true' index='eidx' start='0' end='`$eipam-ip-block.createPoolResponse.CreatePoolPlans_length`' >
+ <switch test="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.PlanName == $network-model.eipam-v4-address-plan`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="v4.ip-prefix" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.IPAddress`"/>
+ <parameter name="v4.mask" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.Mask`"/>
+ <parameter name="v4.entity-id" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.IpamPoolAllocId`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.eipam-v6-address-plan != ''`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="network-topology.network-identifier-structure.eipam-v6-address-plan" value="`$network-model.eipam-v4-address-plan`" />
+ </set>
+ <for silentFailure='true' index='eidx' start='0' end='`$eipam-ip-block.createPoolResponse.CreatePoolPlans_length`' >
+ <switch test="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.PlanName == $network-model.eipam-v6-address-plan`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name="v6.ip-prefix" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.IPAddress`"/>
+ <parameter name="v6.mask" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.Mask`"/>
+ <parameter name="v6.entity-id" value="`$eipam-ip-block.createPoolResponse.CreatePoolPlans[$eidx].CreatePoolPlan.IPDataBlock.IpamPoolAllocId`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <!--tmp.level should be set to 1-->
+ <call module='GENERIC-RESOURCE-API' rpc='create-l3-subnet' mode='sync' ></call>
+ <switch test='`$tmp.l3-network.service-id`'>
+ <outcome value=''>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="network-name" value="`$tmp.l3-network.network-name`" />
+ <parameter name="network-type" value="`$network-model.network-type`" />
+ <parameter name="network-role" value="`$network-model.network-role`" />
+ <parameter name="network-technology" value="`$network-model.network-technology`" />
+ <parameter name="is-bound-to-vpn" value="`$tmp.l3-network.is-bound-to-vpn-boolean`" />
+ <parameter name="tenant-id" value="`$network-topology-operation-input.network-request-information.tenant`" />
+ <parameter name="model-invariant-id" value="`$network-model.invariant_uuid`" />
+ <parameter name="model-version" value="`$network-model.version`" />
+ <parameter name="model-customization-id" value="`$network-model.customization-id`" />
+ <parameter name="physical-network-name" value="`$network-model.physical-network-name`" />
+ <parameter name="is-provider-network" value="`$tmp.l3-network.is-provider-network-boolean`" />
+ <parameter name="is-shared-network" value="`$tmp.l3-network.is-shared-network-boolean`" />
+ <parameter name="is-external-network" value="`$tmp.l3-network.is-external-network-boolean`" />
+ <parameter name="selflink" value="`$tmp.l3-network.self-link`" />
+ <parameter name="operational-status" value="out-of-service-path" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`" />
+ </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="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`" />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='Other'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="network-name" value="`$tmp.l3-network.network-name`" />
+ <parameter name="network-type" value="`$network-model.network-type`" />
+ <parameter name="network-role" value="`$network-model.network-role`" />
+ <parameter name="network-technology" value="`$network-model.network-technology`" />
+ <parameter name="is-bound-to-vpn" value="`$tmp.l3-network.is-bound-to-vpn-boolean`" />
+ <parameter name="tenant-id" value="`$network-topology-operation-input.network-request-information.tenant`" />
+ <parameter name="model-invariant-id" value="`$network-model.invariant_uuid`" />
+ <parameter name="model-version" value="`$network-model.version`" />
+ <parameter name="model-customization-id" value="`$network-model.customization-id`" />
+ <parameter name="physical-network-name" value="`$network-model.physical-network-name`" />
+ <parameter name="is-provider-network" value="`$tmp.l3-network.is-provider-network-boolean`" />
+ <parameter name="is-shared-network" value="`$tmp.l3-network.is-shared-network-boolean`" />
+ <parameter name="is-external-network" value="`$tmp.l3-network.is-external-network-boolean`" />
+ <parameter name="selflink" value="`$tmp.l3-network.self-link`" />
+ <parameter name="service-id" value="`$tmp.l3-network.service-id`" />
+ <parameter name="operational-status" value="out-of-service-path" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`" />
+ </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="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`" />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="msidx" value="`$nig.subnets_length`" />
+ </set>
+ <for index='sidx' start='0' end='`$tmp.l3-network.subnet_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`"/>
+ </set>
+ <switch test='`$tmp.l3-network.subnet[$sidx].dhcp-enabled`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <switch test='`$tmp.l3-network.subnet[$sidx].gateway-address`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-start" value="`$tmp.l3-network.subnet[$sidx].dhcp-start`" />
+ <parameter name="dhcp-end" value="`$tmp.l3-network.subnet[$sidx].dhcp-end`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="gateway-address" value="`$tmp.l3-network.subnet[$sidx].gateway-address`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-start" value="`$tmp.l3-network.subnet[$sidx].dhcp-start`" />
+ <parameter name="dhcp-end" value="`$tmp.l3-network.subnet[$sidx].dhcp-end`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$tmp.l3-network.subnet[$sidx].gateway-address`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.l3-network.network-id
+ AND subnet.subnet-id = $tmp.subnet-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.l3-network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="gateway-address" value="`$tmp.l3-network.subnet[$sidx].gateway-address`" />
+ <parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="nig.subnets[$msidx].start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
+ <parameter name="nig.subnets[$msidx].subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
+ <parameter name="nig.subnets[$msidx].subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
+ <parameter name="nig.subnets[$msidx].gateway-address" value="`$tmp.l3-network.subnet[$sidx].gateway-address`" />
+ <parameter name="nig.subnets[$msidx].cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
+ <parameter name="nig.subnets[$msidx].ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
+ <parameter name="nig.subnets[$msidx].dhcp-start-address" value="`$tmp.l3-network.subnet[$sidx].dhcp-start`" />
+ <parameter name="nig.subnets[$msidx].dhcp-end-address" value="`$tmp.l3-network.subnet[$sidx].dhcp-end`" />
+ <parameter name="nig.subnets[$msidx].dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ </set>
+ <set>
+ <parameter name="msidx" value="`$msidx + 1`" />
+ <parameter name="nig.subnets_length" value="`$nig.subnets_length + 1`" />
+ </set>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic='true'>
+ <switch test='`$ngnidx`'>
+ <outcome value=''>
+ <for index='sidx' start='0' end='`$tmp.l3-network.subnet_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`"/>
+ </set>
+ <switch test='`$tmp.l3-network.subnet[$sidx].dhcp-enabled`'></switch>
+ </block>
+ </for>
+ </outcome>
+ <outcome value='Other'></outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.network-id"
+ force="true"
+ local-only="false">
+ <parameter name="relationship-list.relationship[0].related-to" value="instance-group" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`'/aai/v$/network/instance-groups/instance-group/'+ $tmp.network-instance-group-id`" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving instance-group relationship for l3-network in AnAI where instance-group-id = ' + $tmp.network-instance-group-id`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving instance-group relationship for l3-network in AnAI where instance-group-id = ' + $tmp.network-instance-group-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.l3-network.network-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="service-instance" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="customer.global-customer-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$service-data.service-information.global-customer-id`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-key" value="service-subscription.service-type" />
+ <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-value" value="`$service-data.service-information.subscription-service-type`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-key" value="service-instance.service-instance-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-value" value="`$service-data.service-information.service-instance-id`" />
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving service-instance relationship for l3-network in AnAI where service-instance-id = ' + $network-topology-operation-input.service-information.service-instance-id`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic='true'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving service-instance relationship for l3-network in AnAI where service-instance-id = ' + $network-topology-operation-input.service-information.service-instance-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='network-topology.network-topology-identifier-structure.' value='`$tmp.l3-network.`' />
+ <parameter name='network-topology.tenant' value='`$network-topology-operation-input.network-request-input.tenant`' />
+ <parameter name='network-topology.onap-model-information.' value='`$network-topology-operation-input.network-information.onap-model-information.`' />
+ <parameter name='network-topology.network-parameters.' value='`$network-topology-operation-input.network-request-input.network-parameters.`' />
+ <parameter name='network-topology.aic-cloud-region' value='`$network-topology-operation-input.network-request-input.aic-cloud-region`' />
+ </set>
+ <set>
+ <parameter name="service-data.network-instance-groups.network-instance-group[$ngidx]." value='`$nig.`' />
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$nidx].network-id" value='`$tmp.l3-network.network-id`' />
+ <parameter name="service-data.networks.network[$nidx].network-data.network-topology." value='$network-topology.' />
+ <parameter name="service-data.networks.network_length" value='`$nidx_len`' />
+ </set>
+ <set>
+ <parameter name='networkId' value='`$tmp.l3-network.network-id`' />
+ </set>
+ <set>
+ <parameter name='network-object-path'
+ value="`$tmp.l3-network.self-link`"/>
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.order-status' value='PendingCreate' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.last-rpc-action' value='`$network-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.last-action' value='`$network-topology-operation-input.request-information.request-action`' />
+ </set>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-assign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-assign.xml
index 9fd7e92a..1f6f5d85 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-assign.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-assign.xml
@@ -1,779 +1,103 @@
-<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='network-topology-operation-assign' mode='sync'>
-<block atomic="true"><switch test='`$network-model.is-bound-to-vpn`'>
-<outcome value='Y'>
-<block atomic="true">
-<get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key='SELECT * from VPN_BINDINGS WHERE network_customization_uuid = $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid'
- pfx='vpn-bindings[]'>
-
-<outcome value='success'>
-<block atomic="true"><set>
-<parameter name='hasVpnBindings' value='true' />
-</set><for index='vidx' start='0' end='`$vpn-bindings_length`' >
-<block atomic="true"><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="vpn-binding"
- key="vpn-binding.vpn-id = $vpn-bindings[$vidx].binding-uuid"
- pfx='aai.vpnBinding' local-only='false' >
-
-<outcome value='success'>
-<block>
-</block></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 vpn binding found for network-model.vpn-binding='
- + $vpn-bindings[$vidx].binding-uuid`" />
-
-</return></outcome><outcome value='Other'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'No vpn binding found for network-model.vpn-binding='
- + $vpn-bindings[$vidx].binding-uuid`" />
-
-</return></outcome></get-resource></block></for></block></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="Network model is_bound_to_vpn=true but no vpn_binding is present" />
-
-</return></outcome><outcome value='Other'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Unexpected error retrieving vpn binding" />
-
-</return></outcome></get-resource></block></outcome></switch><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="tenant"
- key="cloud-region.cloud-owner = 'CloudOwner' AND
- cloud-region.cloud-region-id = $network-topology-operation-input.network-request-input.aic-cloud-region AND
- tenant.tenant-id = $network-topology-operation-input.network-request-input.tenant"
- pfx='aai.tenant' local-only='false' >
-
-<outcome value='success'>
-<block atomic="true"></block></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="Tenant not found in AAI" />
-
-</return></outcome><outcome value='Other'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Tenant not found in AAI" />
-
-</return></outcome></get-resource><switch test='`$network-topology-operation-input.network-request-input.network-name`'>
-<outcome value=''>
-<block atomic="true"><switch test='`$network-model.ecomp-generated-naming`'>
-<outcome value='Y'>
-<block atomic="true">
-<switch test='`$network-model.naming-policy`'>
-<outcome value='org.openecomp.policy.naming.ViprProtectedOam.ViprOamProtectedNetwork'>
-<block atomic="true"><set>
-<parameter name='tmp.network-name-prefix' value='$TenantName_int_$role_net' />
-</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.network-name-prefix`"/>
- <parameter name="outputPath" value="tmp.network-name-prefix"/>
- <parameter name="target" value="$TenantName"/>
- <parameter name="replacement" value="`$aai.tenant.tenant-name`"/>
-
-</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.network-name-prefix`"/>
- <parameter name="outputPath" value="tmp.network-name-prefix"/>
- <parameter name="target" value="$role"/>
- <parameter name="replacement" value="`$network-model.network-role`"/>
-
-</execute><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key='SELECT * from NETWORK_INSTANCE_NAME_INDEX WHERE network_instance_name_prefix
- = $tmp.network-name-prefix'
- pfx='db.network-name-prefix'>
-
-<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 the NETWORK_INSTANCE_NAME_INDEX table" />
-</return></outcome></get-resource><switch test='`$db.network-name-prefix.index-number`'>
-<outcome value='Other'>
-<block atomic="true"><set>
-<parameter name='tmp.index-number' value='`$db.network-name-prefix.index-number+1`' />
-</set><save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key="update NETWORK_INSTANCE_NAME_INDEX
- set index_number = $tmp.index-number
- where network_instance_name_prefix = $db.network-name-prefix.network-instance-name-prefix "
- force='false' pfx='pfx'>
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Failed to update SERVICE_INSTANCE_NAME_INDEX table" />
-</return></outcome></save></block></outcome><outcome value=''><block atomic="true"><set>
-<parameter name='tmp.index-number' value='1' />
-</set><save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key="insert into NETWORK_INSTANCE_NAME_INDEX values ( $tmp.network-name-prefix , 1)"
- force='false' pfx='pfx'>
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Failed to insert record into SERVICE_INSTANCE_NAME_INDEX table" />
-</return></outcome></save></block></outcome></switch><set>
-<parameter name='tmp.network-instance-name' value="`$tmp.network-name-prefix + '_' + $tmp.index-number`" />
-</set></block></outcome><outcome value='oam_vipr_protected_network'>
-<block atomic="true"><set>
-<parameter name='tmp.network-name-prefix' value='$TenantName_int_$role_net' />
-</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.network-name-prefix`"/>
- <parameter name="outputPath" value="tmp.network-name-prefix"/>
- <parameter name="target" value="$TenantName"/>
- <parameter name="replacement" value="`$aai.tenant.tenant-name`"/>
-
-</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.network-name-prefix`"/>
- <parameter name="outputPath" value="tmp.network-name-prefix"/>
- <parameter name="target" value="$role"/>
- <parameter name="replacement" value="`$network-model.network-role`"/>
-
-</execute><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key='SELECT * from NETWORK_INSTANCE_NAME_INDEX WHERE network_instance_name_prefix
- = $tmp.network-name-prefix'
- pfx='db.network-name-prefix'>
-
-<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 the NETWORK_INSTANCE_NAME_INDEX table" />
-</return></outcome></get-resource><switch test='`$db.network-name-prefix.index-number`'>
-<outcome value='Other'>
-<block atomic="true"><set>
-<parameter name='tmp.index-number' value='`$db.network-name-prefix.index-number+1`' />
-</set><save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key="update NETWORK_INSTANCE_NAME_INDEX
- set index_number = $tmp.index-number
- where network_instance_name_prefix = $db.network-name-prefix.network-instance-name-prefix "
- force='false' pfx='pfx'>
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Failed to update SERVICE_INSTANCE_NAME_INDEX table" />
-</return></outcome></save></block></outcome><outcome value=''><block atomic="true"><set>
-<parameter name='tmp.index-number' value='1' />
-</set><save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key="insert into NETWORK_INSTANCE_NAME_INDEX values ( $tmp.network-name-prefix , 1)"
- force='false' pfx='pfx'>
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Failed to insert record into SERVICE_INSTANCE_NAME_INDEX table" />
-</return></outcome></save></block></outcome></switch><set>
-<parameter name='tmp.network-instance-name' value="`$tmp.network-name-prefix + '_' + $tmp.index-number`" />
-</set></block></outcome><outcome value='network_without_route_tags_naming_default'>
-<block atomic="true"><set>
-<parameter name='tmp.network-name-prefix' value='$TenantName_int_$role_net' />
-</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.network-name-prefix`"/>
- <parameter name="outputPath" value="tmp.network-name-prefix"/>
- <parameter name="target" value="$TenantName"/>
- <parameter name="replacement" value="`$aai.tenant.tenant-name`"/>
-
-</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.network-name-prefix`"/>
- <parameter name="outputPath" value="tmp.network-name-prefix"/>
- <parameter name="target" value="$role"/>
- <parameter name="replacement" value="`$network-model.network-role`"/>
-
-</execute><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key='SELECT * from NETWORK_INSTANCE_NAME_INDEX WHERE network_instance_name_prefix
- = $tmp.network-name-prefix'
- pfx='db.network-name-prefix'>
-
-<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 the NETWORK_INSTANCE_NAME_INDEX table" />
-</return></outcome></get-resource><switch test='`$db.network-name-prefix.index-number`'>
-<outcome value='Other'>
-<block atomic="true"><set>
-<parameter name='tmp.index-number' value='`$db.network-name-prefix.index-number+1`' />
-</set><save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key="update NETWORK_INSTANCE_NAME_INDEX
- set index_number = $tmp.index-number
- where network_instance_name_prefix = $db.network-name-prefix.network-instance-name-prefix "
- force='false' pfx='pfx'>
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Failed to update SERVICE_INSTANCE_NAME_INDEX table" />
-</return></outcome></save></block></outcome><outcome value=''><block atomic="true"><set>
-<parameter name='tmp.index-number' value='1' />
-</set><save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key="insert into NETWORK_INSTANCE_NAME_INDEX values ( $tmp.network-name-prefix , 1)"
- force='false' pfx='pfx'>
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Failed to insert record into SERVICE_INSTANCE_NAME_INDEX table" />
-</return></outcome></save></block></outcome></switch><set>
-<parameter name='tmp.network-instance-name' value="`$tmp.network-name-prefix + '_' + $tmp.index-number`" />
-</set></block></outcome><outcome value='org.openecomp.policy.naming.SriovProvider.SriovProviderNetwork'>
-<block atomic="true"><set>
-<parameter name='tmp.network-name-prefix' value='$TenantName_$role_net' />
-</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.network-name-prefix`"/>
- <parameter name="outputPath" value="tmp.network-name-prefix"/>
- <parameter name="target" value="$TenantName"/>
- <parameter name="replacement" value="`$aai.tenant.tenant-name`"/>
-
-</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.network-name-prefix`"/>
- <parameter name="outputPath" value="tmp.network-name-prefix"/>
- <parameter name="target" value="$role"/>
- <parameter name="replacement" value="`$network-model.network-role`"/>
-
-</execute><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key='SELECT * from NETWORK_INSTANCE_NAME_INDEX WHERE network_instance_name_prefix
- = $tmp.network-name-prefix'
- pfx='db.network-name-prefix'>
-
-<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 the NETWORK_INSTANCE_NAME_INDEX table" />
-</return></outcome></get-resource><switch test='`$db.network-name-prefix.index-number`'>
-<outcome value='Other'>
-<block atomic="true"><set>
-<parameter name='tmp.index-number' value='`$db.network-name-prefix.index-number+1`' />
-</set><save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key="update NETWORK_INSTANCE_NAME_INDEX
- set index_number = $tmp.index-number
- where network_instance_name_prefix = $db.network-name-prefix.network-instance-name-prefix "
- force='false' pfx='pfx'>
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Failed to update SERVICE_INSTANCE_NAME_INDEX table" />
-</return></outcome></save></block></outcome><outcome value=''><block atomic="true"><set>
-<parameter name='tmp.index-number' value='1' />
-</set><save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key="insert into NETWORK_INSTANCE_NAME_INDEX values ( $tmp.network-name-prefix , 1)"
- force='false' pfx='pfx'>
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Failed to insert record into SERVICE_INSTANCE_NAME_INDEX table" />
-</return></outcome></save></block></outcome></switch><set>
-<parameter name='tmp.network-instance-name' value="`$tmp.network-name-prefix + '_' + $tmp.index-number`" />
-</set></block></outcome><outcome value='sriov_provider_network'>
-<block atomic="true"><set>
-<parameter name='tmp.network-name-prefix' value='$TenantName_$role_net' />
-</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.network-name-prefix`"/>
- <parameter name="outputPath" value="tmp.network-name-prefix"/>
- <parameter name="target" value="$TenantName"/>
- <parameter name="replacement" value="`$aai.tenant.tenant-name`"/>
-
-</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.network-name-prefix`"/>
- <parameter name="outputPath" value="tmp.network-name-prefix"/>
- <parameter name="target" value="$role"/>
- <parameter name="replacement" value="`$network-model.network-role`"/>
-
-</execute><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key='SELECT * from NETWORK_INSTANCE_NAME_INDEX WHERE network_instance_name_prefix
- = $tmp.network-name-prefix'
- pfx='db.network-name-prefix'>
-
-<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 the NETWORK_INSTANCE_NAME_INDEX table" />
-</return></outcome></get-resource><switch test='`$db.network-name-prefix.index-number`'>
-<outcome value='Other'>
-<block atomic="true"><set>
-<parameter name='tmp.index-number' value='`$db.network-name-prefix.index-number+1`' />
-</set><save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key="update NETWORK_INSTANCE_NAME_INDEX
- set index_number = $tmp.index-number
- where network_instance_name_prefix = $db.network-name-prefix.network-instance-name-prefix "
- force='false' pfx='pfx'>
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Failed to update SERVICE_INSTANCE_NAME_INDEX table" />
-</return></outcome></save></block></outcome><outcome value=''><block atomic="true"><set>
-<parameter name='tmp.index-number' value='1' />
-</set><save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key="insert into NETWORK_INSTANCE_NAME_INDEX values ( $tmp.network-name-prefix , 1)"
- force='false' pfx='pfx'>
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Failed to insert record into SERVICE_INSTANCE_NAME_INDEX table" />
-</return></outcome></save></block></outcome></switch><set>
-<parameter name='tmp.network-instance-name' value="`$tmp.network-name-prefix + '_' + $tmp.index-number`" />
-</set></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="`'Unknown naming policy = '
- + $network-model.naming-policy`" />
-
-</return></outcome></switch></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="Network name is required if ecomp naming is false" />
-
-</return></outcome></switch></block></outcome><outcome value='Other'>
-<block atomic="true"><set>
-<parameter name='tmp.network-instance-name' value="`$network-topology-operation-input.network-request-input.network-name`" />
-</set></block></outcome></switch><call module='GENERIC-RESOURCE-API' rpc='generate-l3network-network-id' mode='sync' >
-</call><set>
-<parameter name='tmp.l3-network.network-id' value="`$tmp.return.generate-l3network-network-id.uuid`" />
-<parameter name='tmp.l3-network.network-name' value="`$tmp.network-instance-name`" />
-<parameter name='tmp.l3-network.network-type' value="`$network-model.network-type`" />
-<parameter name='tmp.l3-network.network-role' value="`$network-model.network-role`" />
-<parameter name='tmp.l3-network.network-technology' value="`$network-model.network-technology`" />
-<parameter name='tmp.l3-network.is-bound-to-vpn' value="`$network-model.is-bound-to-vpn`" />
-<parameter name='tmp.l3-network.orchestration-status' value="PendingCreate" />
-<parameter name='tmp.l3-network.model-invariant-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`" />
-<parameter name='tmp.l3-network.model-version-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-version`" />
-<parameter name='tmp.l3-network.model-customization-id' value="`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`" />
-<parameter name='tmp.l3-network.is-provider-network' value="`$network-model.is-provider-network`" />
-<parameter name='tmp.l3-network.is-shared-network' value="`$network-model.is-shared-network`" />
-<parameter name='tmp.l3-network.is-external-network' value="`$network-model.is-external-network`" />
-<parameter name='tmp.l3-network.eipam-v6-address-plan' value="`$network-model.eipam-v6-address-plan`" />
-<parameter name='tmp.l3-network.eipam-v4-address-plan' value="`$network-model.eipam-v4-address-plan`" />
-<parameter name='tmp.l3-network.service-id' value="`$service-data.service-information.service-id`" />
-<parameter name='tmp.l3-network.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
- + $network-topology-operation-input.service-information.service-instance-id
- + '/service-data/networks/network/'
- + $tmp.l3-network.network-id
- + '/network-data/network-topology/'` " />
-</set><switch test='`$network-model.is-provider-network`'>
-<outcome value='Y'>
-<set>
-<parameter name='tmp.l3-network.physical-network-name' value="`$network-model.physical-network-name`" />
-<parameter name='tmp.l3-network.is-provider-network-boolean' value='true' /></set></outcome><outcome value='Other'>
-<set>
-<parameter name='tmp.l3-network.physical-network-name' value="" />
-<parameter name='tmp.l3-network.is-provider-network-boolean' value='false' /></set></outcome></switch><switch test='`$network-model.is-shared-network`'>
-<outcome value='Y'>
-<set>
-<parameter name='tmp.l3-network.is-shared-network-boolean' value='true' /></set></outcome><outcome value='Other'>
-<set>
-<parameter name='tmp.l3-network.is-shared-network-boolean' value='false' /></set></outcome></switch><switch test='`$network-model.is-external-network`'>
-<outcome value='Y'>
-<set>
-<parameter name='tmp.l3-network.is-external-network-boolean' value='true' /></set></outcome><outcome value='Other'>
-<set>
-<parameter name='tmp.l3-network.is-external-network-boolean' value='false' /></set></outcome></switch><set>
-<parameter name='tmp.complex-found' value='false' />
-
-</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 = $network-topology-operation-input.network-request-input.aic-cloud-region AND
- depth = '0'"
- 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><switch test='`$aai.cloud-region.relationship-list.relationship_length`'>
-<outcome value='0'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Cloud region missing relationships in AAI" />
-</return></outcome><outcome value=''>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Cloud region missing relationships in AAI" />
-</return></outcome></switch><for silentFailure='false' index='ridx' start='0' end="`$aai.cloud-region.relationship-list.relationship_length`" >
-<for silentFailure='false' index='rdidx' start='0' end="`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data_length`" >
-<switch test='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
-<outcome value='complex.physical-location-id'>
-<block atomic="true"><set>
-<parameter name='tmp.complex-found' value='true' />
-
-</set><set>
-<parameter name='service-data.network-request-input.aic-clli' value='`$aai.complex.physical-location-id`' />
-
-</set><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="complex"
- key="complex.physical-location-id = $aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
- pfx='aai.complex' local-only='false' >
-
-
-
-<outcome value='success'>
-<block atomic="true"><switch test='`$aai.complex.region`'>
-<outcome value='USA'>
-<block>
-</block></outcome><outcome value='US'>
-<block>
-</block></outcome><outcome value='CALA'>
-<block>
-</block></outcome><outcome value='EMEA'>
-<block>
-</block></outcome><outcome value='AP'>
-<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="Complex.region unknown" />
-</return></outcome></switch></block></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="Complex 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 complex from AAI" />
-</return></outcome></get-resource></block></outcome></switch></for></for><switch test='`$tmp.complex-found`'>
-<outcome value='false'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Complex not found in AAI" />
-</return></outcome></switch><switch test='`$network-model.network-technology`'>
-<outcome value='Contrail'>
-<block atomic="true"><switch test="`$network-model.use-ipv4`"><outcome value='Y'><block atomic='true'><switch test='`$network-model.eipam-v4-address-plan`'>
-<outcome value='AIC_ATM_UNPROTECTED_V4'><block>
-</block></outcome><outcome value='AIC_ATM_PROTECTED_V4'><block>
-</block></outcome><outcome value='AIC_AIM_LANDING_NETWORK_V4'><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="Invalid address plan for VIPR" />
-</return></outcome></switch></block></outcome></switch><switch test="`$network-model.use-ipv6`"><outcome value='Y'><block atomic='true'><switch test='`$network-model.eipam-v6-address-plan`'>
-<outcome value='AIC_ATM_UNPROTECTED_V6'><block>
-</block></outcome><outcome value='AIC_ATM_PROTECTED_V6'><block>
-</block></outcome><outcome value='AIC_AIM_LANDING_NETWORK_V6'><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="EIPAM V6 Address plan should be null" />
-</return></outcome></switch></block></outcome></switch></block></outcome><outcome value='AIC_SR_IOV'>
-<block atomic="true"><switch test="`$network-model.use-ipv4`"><outcome value='Y'><block atomic='true'><switch test='`$network-model.eipam-v4-address-plan`'>
-<outcome value='AIC_DATA_PLANE_UNPROTECTED_V4'><block>
-</block></outcome><outcome value='AIC_DATA_PLANE_PROTECTED_V4'><block>
-</block></outcome><outcome value='AIC_DATA_PLANE_PRIVATE_V4'><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="Invalid address plan for SRIOV" />
-</return></outcome></switch></block></outcome></switch><switch test="`$network-model.use-ipv6`"><outcome value='Y'><block atomic='true'><switch test='`$network-model.eipam-v6-address-plan`'>
-<outcome value="AIC_ATM_UNPROTECTED_V6"><block>
-</block></outcome><outcome value="AIC_ATM_PROTECTED_V6"><block>
-</block></outcome><outcome value="AIC_DATA_PLANE_UNPROTECTED_V6"><block>
-</block></outcome><outcome value="AIC_DATA_PLANE_PRIVATE_V6"><block>
-</block></outcome><outcome value="AIC_DATA_PLANE_PROTECTED_V6"><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="Invalid ipv6 address plan for SRIOV" />
-</return></outcome></switch></block></outcome></switch></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="Invalid network-technology. Only AIC_SR_IOV and Contrail are supported" />
-</return></outcome></switch><set>
-<parameter name='tmp.process-eipam-action' value='assign' />
-</set><!--tmp.level should be set to 1--><call module='GENERIC-RESOURCE-API' rpc='process-eipam-pools' mode='sync' >
-</call><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.process-eipam-pools:REQID"/>
-<parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
-<parameter name="field4" value="Values after process-eipam"/>
-<parameter name="field5" value="`level1-v4-mask`"/>
-<parameter name="field6" value="`$tmp.l3-network.level1.v4.mask`"/>
-<parameter name="field7" value="`level1-v4-ipprefix`"/>
-<parameter name="field8" value="`$tmp.l3-network.level1.v4.ip-prefix`"/>
-<parameter name="field9" value="`level1-v4-entity-id`"/>
-<parameter name="field10" value="`$tmp.l3-network.level1.v4.entity-id`"/>
-<parameter name="field11" value="`level2-v4-mask`"/>
-<parameter name="field12" value="`$tmp.l3-network.level2.v4.mask`"/>
-<parameter name="field13" value="`level2-v4-ipprefix`"/>
-<parameter name="field14" value="`$tmp.l3-network.level2.v4.ip-prefix`"/>
-<parameter name="field15" value="`level2-v4-entity-id`"/>
-<parameter name="field16" value="`$tmp.l3-network.level2.v4.entity-id`"/>
-
-
-</record><!--tmp.level should be set to 1--><call module='GENERIC-RESOURCE-API' rpc='create-l3-subnet' mode='sync' >
-</call><set>
-<parameter name='tmp.network-topology.network-topology-identifier-structure.network-id' value="`$tmp.l3-network.network-name`" />
-<parameter name='tmp.network-topology.network-topology-identifier-structure.network-name' value="`$tmp.l3-network.network-name`" />
-<parameter name='tmp.network-topology.network-topology-identifier-structure.network-type' value="`$tmp.l3-network.network-type`" />
-<parameter name='tmp.network-topology.network-topology-identifier-structure.network-role' value="`$tmp.l3-network.network-role`" />
-<parameter name='tmp.network-topology.network-topology-identifier-structure.network-technology' value="`$tmp.l3-network.network-technology`" />
-<parameter name='tmp.network-topology.network-topology-identifier-structure.eipam-v4-address-plan' value="`$network-model.eipam-v4-address-plan`" />
-<parameter name='tmp.network-topology.network-topology-identifier-structure.eipam-v6-address-plan' value="`$network-model.eipam-v6-address-plan`" />
-<parameter name='tmp.network-topology.region-identifier.tenant' value="`$network-topology-operation-input.network-request-input.tenant`" />
-<parameter name='tmp.network-topology.region-identifier.aic-cloud-region' value="`$network-topology-operation-input.network-request-input.aic-cloud-region`" />
-<parameter name='tmp.network-topology.region-identifier.aic-clli' value="`$network-topology-operation-input.network-request-input.aic-clli`" />
-<parameter name='tmp.network-topology.onap-model-information.' value="`$network-topology-operation-input.network-information.onap-model-information.`" />
-<parameter name='tmp.network-topology.network-parameters.' value="`$network-topology-operation-input.network-request-input.network-input-parameters.`" />
-</set><save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="l3-network"
- key="l3-network.network-id = $tmp.l3-network.network-id" >
-<!-- Create l3-network object -->
-<parameter name="network-id" value="`$tmp.l3-network.network-id`" />
-<parameter name="network-name" value="`$tmp.l3-network.network-name`" />
-<parameter name="network-type" value="`$tmp.l3-network.network-type`" />
-<parameter name="network-role" value="`$tmp.l3-network.network-role`" />
-<parameter name="network-technology" value="`$tmp.l3-network.network-technology`" />
-<parameter name="is-bound-to-vpn" value="`$tmp.l3-network.is-bound-to-vpn`" />
-<parameter name="service-id" value="`$tmp.l3-network.service-id`" />
-<parameter name="tenant-id" value="`$network-topology-operation-input.network-request-information.tenant`" />
-<parameter name="orchestration-status" value="PendingCreate" />
-<parameter name="persona-model-id" value="`$tmp.l3-network.persona-model-id`" />
-<parameter name="persona-model-version" value="`$tmp.l3-network.persona-model-version`" />
-<parameter name="persona-model-customization-id" value="`$tmp.l3-network.persona-model-customization-id`" />
-<parameter name="physical-network-name" value="`$tmp.l3-network.physical-network-name`" />
-<parameter name="is-provider-network" value="`$tmp.l3-network.is-provider-network-boolean`" />
-<parameter name="is-shared-network" value="`$tmp.l3-network.is-shared-network-boolean`" />
-<parameter name="is-external-network" value="`$tmp.l3-network.is-external-network-boolean`" />
-<parameter name="selflink" value="`$tmp.l3-network.self-link`" />
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`" />
-</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="`'Failed to save l3-network in AAI for network-id = ' + $tmp.l3-network.network-id`" />
-</return></outcome></save><for index='sidx' start='0' end='`$tmp.l3-network.subnet_length`' >
-<block atomic="true"><set>
-<parameter name="tmp.subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`"/>
- </set><switch test='`$tmp.l3-network.subnet[$sidx].dhcp-enabled`'>
-<outcome value='true'>
-<block atomic="true"><save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="subnet"
- key="l3-network.network-id = $tmp.l3-network.network-id
- AND subnet.subnet-id = $tmp.subnet-id" >
-<!-- Create l3-network object -->
-<parameter name="network-id" value="`$tmp.l3-network.network-id`" />
-<parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
-<parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
-<parameter name="gateway-address" value="`$tmp.l3-network.subnet[$sidx].gateway-address`" />
-<parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
-<parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
-<parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
-<parameter name="dhcp-start" value="`$tmp.l3-network.subnet[$sidx].dhcp-start`" />
-<parameter name="dhcp-end" value="`$tmp.l3-network.subnet[$sidx].dhcp-end`" />
-<parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
-<parameter name="orchestration-status" value="PendingCreate" /><outcome value='failure'>
-<block atomic='true'><set>
- <parameter name="error-code" value="500"/>
- <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/></set><block atomic='true'><delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="l3-network"
- key="l3-network.network-id = $tmp.l3-network.network-id"></delete><return status='failure'>
- <parameter name='error-code' value='500'/>
- <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/></return></block></block></outcome><outcome value='not-found'>
-<block atomic='true'><set>
- <parameter name="error-code" value="500"/>
- <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/></set><block atomic='true'><delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="l3-network"
- key="l3-network.network-id = $tmp.l3-network.network-id"></delete><return status='failure'>
- <parameter name='error-code' value='500'/>
- <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/></return></block></block></outcome></save></block></outcome><outcome value='false'>
-<block atomic="true"><save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="subnet"
- key="l3-network.network-id = $tmp.l3-network.network-id
- AND subnet.subnet-id = $tmp.subnet-id" >
-<!-- Create l3-network object -->
-<parameter name="network-id" value="`$tmp.l3-network.network-id`" />
-<parameter name="subnet-id" value="`$tmp.l3-network.subnet[$sidx].subnet-id`" />
-<parameter name="subnet-name" value="`$tmp.l3-network.subnet[$sidx].subnet-name`" />
-<parameter name="gateway-address" value="`$tmp.l3-network.subnet[$sidx].gateway-address`" />
-<parameter name="network-start-address" value="`$tmp.l3-network.subnet[$sidx].network-start-address`" />
-<parameter name="cidr-mask" value="`$tmp.l3-network.subnet[$sidx].cidr-mask`" />
-<parameter name="ip-version" value="`$tmp.l3-network.subnet[$sidx].ip-version`" />
-<parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet[$sidx].dhcp-enabled`" />
-<parameter name="orchestration-status" value="PendingCreate" /><outcome value='failure'>
-<block atomic='true'><set>
- <parameter name="error-code" value="500"/>
- <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/></set><block atomic='true'><delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="l3-network"
- key="l3-network.network-id = $tmp.l3-network.network-id"></delete><return status='failure'>
- <parameter name='error-code' value='500'/>
- <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/></return></block></block></outcome><outcome value='not-found'>
-<block atomic='true'><set>
- <parameter name="error-code" value="500"/>
- <parameter name="tmp.error-message" value="`'An error occurred while saving subnet relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/></set><block atomic='true'><delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="l3-network"
- key="l3-network.network-id = $tmp.l3-network.network-id"></delete><return status='failure'>
- <parameter name='error-code' value='500'/>
- <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/></return></block></block></outcome></save></block></outcome></switch></block></for><switch test='`$hasVpnBindings`'>
-<outcome value='true'>
-<block atomic="true"><for index='vidx' start='0' end='`$vpn-bindings_length`' >
-<block atomic='true'><save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="l3-network:relationship-list"
- key="l3-network.network-id = $tmp.l3-network.network-id" >
-<parameter name="relationship-list.relationship[0].related-to" value="vpn-binding" />
-<parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="vpn-binding.vpn-id" />
-<parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$vpn-bindings[$vidx].binding-uuid`" /><outcome value='failure'>
-<block><set>
- <parameter name="error-code" value="500"/>
- <parameter name="tmp.error-message" value="`'An error occurred while saving vpn binding relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/></set><block atomic='true'><delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="l3-network"
- key="l3-network.network-id = $tmp.l3-network.network-id"></delete><return status='failure'>
- <parameter name='error-code' value='500'/>
- <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/></return></block></block></outcome><outcome value='not-found'>
-<block><set>
- <parameter name="error-code" value="500"/>
- <parameter name="tmp.error-message" value="`'An error occurred while saving vpn binding relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/></set><block atomic='true'><delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="l3-network"
- key="l3-network.network-id = $tmp.l3-network.network-id"></delete><return status='failure'>
- <parameter name='error-code' value='500'/>
- <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/></return></block></block></outcome></save></block></for></block></outcome></switch><save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="l3-network:relationship-list"
- key="l3-network.network-id = $tmp.l3-network.network-id" >
-<parameter name="relationship-list.relationship[0].related-to" value="service-instance" />
-<parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="customer.global-customer-id" />
-<parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$service-data.service-information.global-customer-id`" />
-<parameter name="relationship-list.relationship[0].relationship-data[1].relationship-key" value="service-subscription.service-type" />
-<parameter name="relationship-list.relationship[0].relationship-data[1].relationship-value" value="`$service-data.service-information.subscription-service-type`" />
-<parameter name="relationship-list.relationship[0].relationship-data[2].relationship-key" value="service-instance.service-instance-id" />
-<parameter name="relationship-list.relationship[0].relationship-data[2].relationship-value" value="`$service-data.service-information.service-instance-id`" /><outcome value='failure'>
-<block><set>
- <parameter name="error-code" value="500"/>
- <parameter name="tmp.error-message" value="`'An error occurred while saving service instance relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/></set><block atomic='true'><delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="l3-network"
- key="l3-network.network-id = $tmp.l3-network.network-id"></delete><return status='failure'>
- <parameter name='error-code' value='500'/>
- <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/></return></block></block></outcome><outcome value='not-found'>
-<block><set>
- <parameter name="error-code" value="500"/>
- <parameter name="tmp.error-message" value="`'An error occurred while saving service instance relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/></set><block atomic='true'><delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="l3-network"
- key="l3-network.network-id = $tmp.l3-network.network-id"></delete><return status='failure'>
- <parameter name='error-code' value='500'/>
- <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/></return></block></block></outcome></save><save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="l3-network:relationship-list"
- key="l3-network.network-id = $tmp.l3-network.network-id"
- force="true"
- local-only="false">
- <!-- create relationship-list -->
- <parameter name="relationship-list.relationship[0].related-to" value="tenant" />
- <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="cloud-region.cloud-owner" />
- <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="CloudOwner" />
- <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-key" value="cloud-region.cloud-region-id" />
- <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-value" value="`$network-topology-operation-input.network-request-input.aic-cloud-region`" />
- <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-key" value="tenant.tenant-id" />
- <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-value" value="`$network-topology-operation-input.network-request-input.tenant`" />
- <parameter name="relationship-list.relationship[1].related-to" value="cloud-region" />
- <parameter name="relationship-list.relationship[1].relationship-data[0].relationship-key" value="cloud-region.cloud-owner" />
- <parameter name="relationship-list.relationship[1].relationship-data[0].relationship-value" value="CloudOwner" />
- <parameter name="relationship-list.relationship[1].relationship-data[1].relationship-key" value="cloud-region.cloud-region-id" />
- <parameter name="relationship-list.relationship[1].relationship-data[1].relationship-value" value="`$network-topology-operation-input.network-request-input.aic-cloud-region`" />
-
- <outcome value='failure'>
-<block atomic='true'><set>
- <parameter name="error-code" value="500"/>
- <parameter name="tmp.error-message" value="`'An error occurred while saving tenant and cloud-region relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/></set><block atomic='true'><delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="l3-network"
- key="l3-network.network-id = $tmp.l3-network.network-id"></delete><return status='failure'>
- <parameter name='error-code' value='500'/>
- <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/></return></block></block></outcome><outcome value='not-found'>
-<block atomic='true'><set>
- <parameter name="error-code" value="500"/>
- <parameter name="tmp.error-message" value="`'An error occurred while saving tenant and cloud-region relationship for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/></set><block atomic='true'><delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="l3-network"
- key="l3-network.network-id = $tmp.l3-network.network-id"></delete><return status='failure'>
- <parameter name='error-code' value='500'/>
- <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/></return></block></block></outcome></save><switch test='`$network-model.network-technology`'>
-<outcome value='AIC_SR_IOV'>
-<block atomic="true"><set>
- <parameter name="tmp.l3-network.segmentation-id" value="1"/></set><save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="segmentation-assignment"
- key="l3-network.network-id = $tmp.l3-network.network-id
- AND segmentation-assignment.segmentation-id = $tmp.l3-network.segmentation-id" >
-<!-- Create segmentation-assignment object -->
-<parameter name="network-id" value="`$tmp.l3-network.network-id`" />
-<parameter name="segmentation-id" value="`$tmp.l3-network.segmentation-id`" />
-<outcome value='failure'>
-<block atomic='true'><set>
- <parameter name="error-code" value="500"/>
- <parameter name="tmp.error-message" value="`'An error occurred while saving segmentation-assignment for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/></set><block atomic='true'><delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="l3-network"
- key="l3-network.network-id = $tmp.l3-network.network-id"></delete><return status='failure'>
- <parameter name='error-code' value='500'/>
- <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/></return></block></block></outcome><outcome value='not-found'>
-<block atomic='true'><set>
- <parameter name="error-code" value="500"/>
- <parameter name="tmp.error-message" value="`'An error occurred while saving segmentation-assignment for l3-network in AnAI where network-id = ' + $tmp.l3-network.network-id`"/></set><block atomic='true'><delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="l3-network"
- key="l3-network.network-id = $tmp.l3-network.network-id"></delete><return status='failure'>
- <parameter name='error-code' value='500'/>
- <parameter name='error-message' value="`'Error writing to l3-network - ' + $tmp.error-message`"/></return></block></block></outcome></save></block></outcome></switch><set>
-<parameter name='network-topology.network-topology-identifier-structure.' value='`$tmp.l3-network.`' />
-<parameter name='network-topology.tenant' value='`$network-topology-operation-input.network-request-input.tenant`' />
-<parameter name='network-topology.onap-model-information.' value='`$network-topology-operation-input.network-information.onap-model-information.`' />
-<parameter name='network-topology.network-parameters.' value='`$network-topology-operation-input.network-request-input.network-input-parameters.`' />
-<parameter name='network-topology.aic-cloud-region' value='`$network-topology-operation-input.network-request-input.aic-cloud-region`' /></set><switch test='`$service-data.networks.network_length`'>
-<outcome value=''>
-<set>
-<parameter name='nidx' value='0' />
-</set></outcome><outcome value='Other'>
-<set>
-<parameter name='nidx' value='`$service-data.networks.network_length`' />
-</set></outcome></switch><set>
-<parameter name="service-data.networks.network[$nidx].network-id" value='`$tmp.l3-network.network-id`' />
-<parameter name="service-data.networks.network[$nidx].network-data.network-topology." value='$network-topology.' />
-<parameter name="service-data.networks.network_length" value='`$nidx+1`' />
-
-</set><set>
-<parameter name='service-data.networks.network[$nidx].network-data.sdnc-request-header.' value='`$network-topology-operation-input.sdnc-request-header.`' />
-<parameter name='service-data.networks.network[$nidx].network-data.request-information.' value='`$network-topology-operation-input.request-information.`' />
-<parameter name='service-data.networks.network[$nidx].network-data.service-information.' value='`$network-topology-operation-input.service-information.`' />
-<parameter name='service-data.networks.network[$nidx].network-data.network-information.' value='`$network-topology-operation-input.network-information.`' />
-<parameter name='service-data.networks.network[$nidx].network-data.network-request-input.' value='`$network-topology-operation-input.network-request-input.`' />
-</set><set>
-<parameter name='networkId' value='`$tmp.l3-network.network-id`' />
-</set><set>
-<parameter name='network-object-path'
- value="`$tmp.l3-network.self-link`"/>
-
-</set><set>
-<parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.order-status' value='PendingCreate' />
-<parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.last-rpc-action' value='`$network-topology-operation-input.sdnc-request-header.svc-action`' />
-<parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.last-action' value='`$network-topology-operation-input.request-information.request-action`' />
-</set><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>
+<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='network-topology-operation-assign' mode='sync'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="tenant"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $network-topology-operation-input.network-request-input.aic-cloud-region AND
+ tenant.tenant-id = $network-topology-operation-input.network-request-input.tenant"
+ pfx='aai.tenant' local-only='false' >
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </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="Tenant not found in AAI" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Tenant not found in AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test='`$network-topology-operation-input.network-information.network-id`'>
+ <outcome value=''>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-l3network-network-id' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.return.generate-l3network-network-id.uuid' value='`$network-topology-operation-input.network-information.network-id`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.l3-network.network-id' value='`$tmp.return.generate-l3network-network-id.uuid`' />
+ <parameter name='network-topology-operation-input.network-information.network-id' value='`$tmp.return.generate-l3network-network-id.uuid`' />
+ </set>
+ <switch test='`$network-topology-operation-input.network-information.network-instance-group-id`'>
+ <outcome value=''>
+ <switch test='`$network-topology-operation-input.network-request-input.network-name`'>
+ <outcome value=''>
+ <block atomic="true">
+ <switch test='`$network-model.ecomp-generated-naming`'>
+ <outcome value='Y'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.policy-instance-name' value='`$network-model.naming-policy`' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$tmp.l3-network.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='ASSIGN' />
+ <parameter name='naming-policy-generate-name-input.query-parameter' value='`$network-model.customization-uuid`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <set>
+ <parameter name='tmp.network-instance-name' value='`$naming-policy-generate-name-output.network-name`' />
+ <parameter name='tmp.l3-network.network-name' value='`$naming-policy-generate-name-output.network-name`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-assign-automated' mode='sync' ></call>
+ </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="Network name is required if onap naming is false" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.network-instance-name' value="`$network-topology-operation-input.network-request-input.network-name`" />
+ <parameter name='tmp.l3-network.network-name' value="`$network-topology-operation-input.network-request-input.network-name`" />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-assign-from-preload' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-assign-vlantagging-instancegroup' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-changeassign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-changeassign.xml
new file mode 100755
index 00000000..7d0155a6
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-changeassign.xml
@@ -0,0 +1,1172 @@
+<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='network-topology-operation-changeassign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$service-data.networks.network[$nidx].network-data.network-information.from-preload`'>
+ <outcome value='true'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error: changeassign only allowed for networks with from-preload set to true" />
+ </return>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.preload-network`"/>
+ <parameter name="outputPath" value="tmp.pn-url"/>
+ <parameter name="target" value="{network-name}"/>
+ <parameter name="replacement" value="`$network-topology-operation-input.network-request-information.network-name`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pn-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="preload-data" />
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="'Error: No preload-network found with network-name =' + $tmp.network-instance-name + ' in md-sal'" />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $network-topology-operation-input.network-request-information.network-id
+ AND depth='all'"
+ local-only="false"
+ pfx="tmp.AnAI.l3network">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error retrieving l3-network with network-id=' + $network-topology-operation-input.network-request-information.network-id + ' from AnAI'`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'network-id: ' + $network-topology-operation-input.network-request-information.network-id + 'not found in AnAI'`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test="`$tmp.AnAI.l3network.network-name == $network-data.network-topology.network-topology-identifier-structure.network-name`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'The input network-name,' + network-topology-operation-input.network-request-information.network-name + ', does not match what is returned from AnAI with network-id = ' + $network-topology-operation-input.network-request-information.network-id`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.AnAI.l3network.network-type == $network-data.network-topology.network-topology-identifier-structure.network-type`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'The input network-type,' + network-topology-operation-input.network-request-information.network-type + ', does not match what is returned from AnAI with network-id = ' + $network-topology-operation-input.network-request-information.network-id`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.AnAI.l3network.network-name == $preload-data.preload-network-topology-information.network-topology-identifier.network-name`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'No preload network found with network-name = ' + $tmp.AnAI.l3network.network-name + ' in SDNC'`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.AnAI.l3network.network-type == $preload-data.preload-network-topology-information.network-topology-identifier.network-type`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'No preload network found with network-type = ' + $tmp.AnAI.l3network.network-type + ' in SDNC'`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='x' value='0' />
+ <parameter name='tmp.error-message' value='' />
+ <parameter name='execute_failure' value='false' />
+ <parameter name='tmp.l3networkUpdate' value='0' />
+ </set>
+ <switch test="`$tmp.AnAI.l3network.subnets.subnet_length`">
+ <outcome value=''>
+ <set>
+ <parameter name="tmp.AnAI.l3network.subnets.subnet_length" value="0" />
+ </set>
+ </outcome>
+ </switch>
+ <for index="k" start="0" end="`$tmp.AnAI.l3network.subnets.subnet_length`">
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.start-address-match' value='0' />
+ </set>
+ <set>
+ <parameter name='tmp.subnetUpdate' value='0' />
+ </set>
+ <block atomic='true'>
+ <for index="n" start="0" end="`$preload-data.preload-network-topology-information.subnets_length`">
+ <switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].network-start-address == $preload-data.preload-network-topology-information.subnets[$n].start-address`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.start-address-match' value='1' />
+ </set>
+ <switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].cidr-mask == $preload-data.preload-network-topology-information.subnets[$n].cidr-mask`">
+ <outcome value='false'>
+ <set>
+ <parameter name="tmp.subnetUpdate" value="1" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$preload-data.preload-network-topology-information.subnets[$n].gateway-address`">
+ <outcome value=''>
+ <block>
+ <execute plugin="com.att.sdnctl.sli.plugin.ipAddressTools.IpAddressTool" method="getGatewayAddress">
+ <parameter name="ipAddress" value="`$preload-data.preload-network-topology-information.subnets[$n].start-address`" />
+ <parameter name="ipVersion" value="`$preload-data.preload-network-topology-information.subnets[$n].ip-version`" />
+ <parameter name="subnet" value="`$preload-data.preload-network-topology-information.subnets[$n].cidr-mask`" />
+ <parameter name="ctxVariable" value="tmp.return.generate.gateway-address" />
+ </execute>
+ <switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].gateway-address == $tmp.return.generate.gateway-address`">
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name="tmp.gateway-address" value="`$tmp.return.generate.gateway-address`" />
+ </set>
+ <set>
+ <parameter name="tmp.subnetUpdate" value="1" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].gateway-address == $preload-data.preload-network-topology-information.subnets[$n].gateway-address`">
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name="tmp.gateway-address" value="`$preload-data.preload-network-topology-information.subnets[$n].gateway-address`" />
+ </set>
+ <set>
+ <parameter name="tmp.subnetUpdate" value="1" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <set>
+ <parameter name="tmp.gateway-address" value="`$preload-data.preload-network-topology-information.subnets[$n].gateway-address`" />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test="`$preload-data.preload-network-topology-information.subnets[$n].dhcp-enabled`">
+ <outcome value='N'>
+ <set>
+ <parameter name="tmp.dhcpEnabled.boolean" value="false" />
+ </set>
+ </outcome>
+ <outcome value='Y'>
+ <set>
+ <parameter name="tmp.dhcpEnabled.boolean" value="true" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$preload-data.preload-network-topology-information.subnets[$n].addr-from-start`">
+ <outcome value='N'>
+ <set>
+ <parameter name="tmp.addrFromStart.boolean" value="false" />
+ </set>
+ </outcome>
+ <outcome value='Y'>
+ <set>
+ <parameter name="tmp.addrFromStart.boolean" value="true" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].ip-assignment-direction == $tmp.addrFromStart.boolean`">
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name="tmp.subnetUpdate" value="1" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].dhcp-enabled == $tmp.dhcpEnabled.boolean`">
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name="tmp.subnetUpdate" value="1" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].dhcp-start == $preload-data.preload-network-topology-information.subnets[$n].dhcp-start-address`">
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name="tmp.subnetUpdate" value="1" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].dhcp-end == $preload-data.preload-network-topology-information.subnets[$n].dhcp-end-address`">
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name="tmp.subnetUpdate" value="1" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].subnet-name == $preload-data.preload-network-topology-information.subnets[$n].subnet-name`">
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name="tmp.subnetUpdate" value="1" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].subnet-role == $preload-data.preload-network-topology-information.subnets[$n].subnet-role`">
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name="tmp.subnetUpdate" value="1" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.subnetUpdate == 1`">
+ <outcome value='true'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id
+ AND subnet.subnet-id = $tmp.AnAI.l3network.subnets.subnet[$k].subnet-id" >
+ <!-- Update l3network.subnet -->
+ <parameter name="gateway-address" value="`$tmp.gateway-address`"/>
+ <parameter name="subnet-name" value="`$preload-data.preload-network-topology-information.subnets[$n].subnet-name`"/>
+ <parameter name="cidr-mask" value="`$preload-data.preload-network-topology-information.subnets[$n].cidr-mask`"/>
+ <parameter name="dhcp-start" value="`$preload-data.preload-network-topology-information.subnets[$n].dhcp-start-address`"/>
+ <parameter name="dhcp-end" value="`$preload-data.preload-network-topology-information.subnets[$n].dhcp-end-address`"/>
+ <parameter name="dhcp-enabled" value="`$tmp.dhcpEnabled.boolean`"/>
+ <parameter name="ip-assignment-direction" value="`$tmp.addrFromStart.boolean`" />
+ <parameter name="orchestration-status" value="PendingUpdate" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='k' value='`$tmp.AnAI.l3network.subnets.subnet_length + 1`' />
+ <parameter name='n' value='`$preload-data.preload-network-topology-information.subnets_length + 1`' />
+ </set>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while updating subnet attributes in AnAI with subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$k].subnet-id`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='k' value='`$tmp.AnAI.l3network.subnets.subnet_length + 1`' />
+ <parameter name='n' value='`$preload-data.preload-network-topology-information.subnets_length + 1`' />
+ </set>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while updating subnet attributes in AnAI with subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$k].subnet-id`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name="tmp.subnetRollback[$x].subnet-id" value= "`$tmp.AnAI.l3network.subnets.subnet[$k].subnet-id`"/>
+ <parameter name="tmp.subnetRollback[$x].type" value = "update"/>
+ </set>
+ <set>
+ <parameter name="x" value = "`$x + 1`" />
+ </set>
+ <set>
+ <parameter name="tmp.l3networkUpdate" value="1" />
+ </set>
+ </block>
+ </outcome>
+ </update>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$execute_failure`">
+ <outcome value='false'>
+ <switch test="`$tmp.start-address-match == 0`">
+ <outcome value='true'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id
+ AND subnet.subnet-id = $tmp.AnAI.l3network.subnets.subnet[$k].subnet-id" >
+ <parameter name="orchestration-status" value="PendingDelete" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='k' value='`$tmp.AnAI.l3network.subnets.subnet_length + 1`' />
+ <parameter name='n' value='`$preload-data.preload-network-topology-information.subnets_length + 1`' />
+ </set>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while updating subnet status to PendingDelete in AnAI with subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$k].subnet-id`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='k' value='`$tmp.AnAI.l3network.subnets.subnet_length + 1`' />
+ <parameter name='n' value='`$preload-data.preload-network-topology-information.subnets_length + 1`' />
+ </set>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while updating subnet status to PendingDelete in AnAI with subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$k].subnet-id`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name="tmp.subnetRollback[$x].subnet-id" value= "`$tmp.AnAI.l3network.subnets.subnet[$k].subnet-id`"/>
+ <parameter name="tmp.subnetRollback[$x].orchestration-status" value= "`$tmp.AnAI.l3network.subnets.subnet[$k].orchestration-status`" />
+ <parameter name="tmp.subnetRollback[$x].type" value = "delete" />
+ </set>
+ <set>
+ <parameter name="x" value = "`$x + 1`" />
+ </set>
+ <set>
+ <parameter name="tmp.l3networkUpdate" value="1" />
+ </set>
+ </block>
+ </outcome>
+ </update>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </for>
+ <switch test="`$execute_failure`">
+ <outcome value='false'>
+ <for index="i" start="0" end="`$preload-data.preload-network-topology-information.subnets_length`">
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.start-address-match" value="0" />
+ </set>
+ <block atomic='true'>
+ <for index="j" start="0" end="`$tmp.AnAI.l3network.subnets.subnet_length`">
+ <switch test="`$preload-data.preload-network-topology-information.subnets[$i].start-address == $tmp.AnAI.l3network.subnets.subnet[$j].network-start-address`">
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.start-address-match' value='1' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.start-address-match == 0`">
+ <outcome value='true'>
+ <block atomic="true">
+ <switch test="`$preload-data.preload-network-topology-information.subnets[$i].dhcp-enabled`">
+ <outcome value='N'>
+ <set>
+ <parameter name="tmp.dhcpEnabled.boolean" value="false" />
+ </set>
+ </outcome>
+ <outcome value='Y'>
+ <set>
+ <parameter name="tmp.dhcpEnabled.boolean" value="true" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$preload-data.preload-network-topology-information.subnets[$n].addr-from-start`">
+ <outcome value='N'>
+ <set>
+ <parameter name="tmp.addrFromStart.boolean" value="false" />
+ </set>
+ </outcome>
+ <outcome value='Y'>
+ <set>
+ <parameter name="tmp.addrFromStart.boolean" value="true" />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <set>
+ <parameter name="tmp.addrFromStart.boolean" value="true" />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.gateway-address' value='`$preload-data.preload-network-topology-information.subnets[$i].gateway-address`' />
+ </set>
+ <switch test="`$preload-data.preload-network-topology-information.subnets[$i].gateway-address`">
+ <outcome value=''>
+ <block>
+ <execute plugin="com.att.sdnctl.sli.plugin.ipAddressTools.IpAddressTool" method="getGatewayAddress">
+ <parameter name="ipAddress" value="`$preload-data.preload-network-topology-information.subnets[$i].start-address`" />
+ <parameter name="ipVersion" value="`$preload-data.preload-network-topology-information.subnets[$i].ip-version`" />
+ <parameter name="subnet" value="`$preload-data.preload-network-topology-information.subnets[$i].cidr-mask`" />
+ <parameter name="ctxVariable" value="tmp.return.generate.gateway-address" />
+ </execute>
+ <set>
+ <parameter name="tmp.gateway-address" value="`$tmp.return.generate.gateway-address`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.local.network-id" value="`$tmp.AnAI.l3network.network-id`" />
+ </set>
+ <call module="VNF-API" rpc="generate-subnets-subnet-id" mode="sync" >
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='j' value='`$tmp.AnAI.l3subnet_length + 1`' />
+ <parameter name='i' value='`$preload-data.preload-network-topology-information.subnets_length + 1`' />
+ </set>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving new subnet in AnAI with subnet-id = ' + $tmp.return.generate-subnets-subnet-id.uuid`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id
+ AND subnet.subnet-id = $tmp.return.generate-subnets-subnet-id.uuid" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$tmp.AnAI.l3network.network-id`" />
+ <parameter name="subnet-id" value="`$tmp.return.generate-subnets-subnet-id.uuid`" />
+ <parameter name="gateway-address" value="`$tmp.gateway-address`" />
+ <parameter name="subnet-name" value="`$preload-data.preload-network-topology-information.subnets[$i].subnet-name`" />
+ <parameter name="network-start-address" value="`$preload-data.preload-network-topology-information.subnets[$i].start-address`" />
+ <parameter name="cidr-mask" value="`$preload-data.preload-network-topology-information.subnets[$i].cidr-mask`" />
+ <parameter name="ip-version" value="`$preload-data.preload-network-topology-information.subnets[$i].ip-version`" />
+ <parameter name="dhcp-start" value="`$preload-data.preload-network-topology-information.subnets[$i].dhcp-start-address`" />
+ <parameter name="dhcp-end" value="`$preload-data.preload-network-topology-information.subnets[$i].dhcp-end-address`" />
+ <parameter name="dhcp-enabled" value="`$tmp.dhcpEnabled.boolean`" />
+ <parameter name="ip-assignment-direction" value="`$tmp.addrFromStart.boolean`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='j' value='`$tmp.AnAI.l3subnet_length + 1`' />
+ <parameter name='i' value='`$preload-data.preload-network-topology-information.subnets_length + 1`' />
+ </set>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving new subnet in AnAI with subnet-id = ' + $tmp.return.generate-subnets-subnet-id.uuid`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='j' value='`$tmp.AnAI.l3subnet_length + 1`' />
+ <parameter name='i' value='`$preload-data.preload-network-topology-information.subnets_length + 1`' />
+ </set>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving new subnet in AnAI with subnet-id = ' + $tmp.return.generate-subnets-subnet-id.uuid`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name="tmp.subnetRollback[$x].subnet-id" value= "`$tmp.return.generate-subnets-subnet-id.uuid`" />
+ <parameter name="tmp.subnetRollback[$x].type" value = "create" />
+ </set>
+ <set>
+ <parameter name="x" value = "`$x + 1`" />
+ </set>
+ <set>
+ <parameter name='tmp.l3networkUpdate' value='1' />
+ </set>
+ <block>
+ <set>
+ <parameter name="tmp.local.subnet-id" value="`$tmp.AnAI.l3network.subnets.subnet[$j].subnet-id`" />
+ </set>
+ <switch test='`$preload-data.preload-network-topology-information.subnets[$i].host-routes_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='preload-data.preload-network-topology-information.subnets[$i].host-routes_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index="h" start="0" end="`$preload-data.preload-network-topology-information.subnets[$i].host-routes_length`">
+ <block atomic='true'>
+ <call module="VNF-API" rpc="generate-host-routes-host-route-id" mode="sync" >
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving host-route in AnAI where host-route-id = ' + $tmp.return.generate-host-routes-host-route-id.uuid`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="host-route"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id
+ AND subnet.subnet-id = $tmp.local.subnet-id
+ AND host-route.host-route-id = $tmp.return.generate-host-routes-host-route-id.uuid" >
+ <!-- Create host-route object -->
+ <parameter name="host-route-id" value="`$tmp.return.generate-host-routes-host-route-id.uuid`" />
+ <parameter name="route-prefix" value="`$preload-data.preload-network-topology-information.subnets[$i].host-routes[$h].route-prefix`" />
+ <parameter name="next-hop" value="`$preload-data.preload-network-topology-information.subnets[$i].host-routes[$h].next-hop`" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving host-route in AnAI where host-route-id = ' + $tmp.return.generate-host-routes-host-route-id.uuid`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving host-route in AnAI where host-route-id = ' + $tmp.return.generate-host-routes-host-route-id.uuid`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ <switch test="`$execute_failure`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id
+ AND related-to = vpn-binding" >
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="An error occurred while deleting l3-network vpn-binding relationship from AnAI"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ </delete>
+ <switch test="`$execute_failure`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <switch test="`$preload-data.preload-network-topology-information.vpn-bindings_length`">
+ <outcome value=''>
+ <set>
+ <parameter name="preload-data.preload-network-topology-information.vpn-bindings_length" value="0" />
+ </set>
+ </outcome>
+ </switch>
+ <for index="i" start="0" end="`$preload-data.preload-network-topology-information.vpn-bindings_length`">
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.vpn-binding-id" value="" />
+ </set>
+ <switch test="`$preload-data.preload-network-topology-information.vpn-bindings[$i].vpn-binding-id`">
+ <outcome value='Other'>
+ <set>
+ <parameter name="tmp.vpn-binding-id" value="`$preload-data.preload-network-topology-information.vpn-bindings[$i].vpn-binding-id`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$preload-data.preload-network-topology-information.vpn-bindings[$i].global-route-target != ''`" >
+ <outcome value='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vpn-binding"
+ key="vpn-binding.global-route-target = $preload-data.preload-network-topology-information.vpn-bindings[$i].global-route-target"
+ pfx="tmp.AnAI.vpn-binding">
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query vpn-bindings n AnAI where global-route-target = ' + $preload-data.preload-network-topology-information.vpn-bindings[$i].global-route-target`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query vpn-bindings n AnAI where global-route-target = ' + $preload-data.preload-network-topology-information.vpn-bindings[$i].global-route-target`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name="tmp.vpn-binding-id" value="`$tmp.AnAI.vpn-binding.vpn-id`" />
+ </set>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ <switch test="`$execute_failure`">
+ <outcome value='false'>
+ <switch test="`$tmp.vpn-binding-id != ''`">
+ <outcome value='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="vpn-binding" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="vpn-binding.vpn-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.vpn-binding-id`" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving l3-newtork vpn-binding relationship in AnAI where vpn-id = ' + $tmp.vpn-binding-id`"/>
+ </set>
+ <set>
+ <parameter name="i" value = "`$preload-data.preload-network-topology-information.vpn-bindings_length + 1`" />
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving l3-newtork vpn-binding relationship in AnAI where vpn-id = ' + $tmp.vpn-binding-id`"/>
+ </set>
+ <set>
+ <parameter name="i" value = "`$preload-data.preload-network-topology-information.vpn-bindings_length + 1`" />
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.vpn-binding.updated' value='1' />
+ </set>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$execute_failure`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id
+ AND related-to = network-policy" >
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="An error occurred while deleting l3-network network-policy relationship from AnAI in preparation to regenerate the network-policy relationship from PRELOAD."/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ </delete>
+ <switch test="`$execute_failure`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <switch test="`$preload-data.preload-network-topology-information.network-policy_length`">
+ <outcome value=''>
+ <set>
+ <parameter name='preload-data.preload-network-topology-information.network-policy_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index="i" start="0" end="`$preload-data.preload-network-topology-information.network-policy_length`">
+ <switch test="`$preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn != NULL`">
+ <outcome value='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-policy"
+ key="network-policy.network-policy-fqdn = $preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn"
+ pfx="tmp.AnAI.network-policy" >
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query network-policy n AnAI where network-policy-fqdn = ' + $preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query network-policy n AnAI where network-policy-fqdn = ' + $preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="network-policy" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="network-policy.network-policy-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.AnAI.network-policy.network-policy-id`" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving l3-newtork network-policy relationship in AnAI where network-policy-id = ' + $tmp.AnAI.network-policy.network-policy-id`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.network-policy.updated' value='1' />
+ </set>
+ </outcome>
+ </save>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$execute_failure`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id
+ AND related-to = route-table-reference" >
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="An error occurred while deleting l3-network route-table-reference relationship from AnAI prior to regenerate the route-table-reference relationship from PRELOAD."/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ </delete>
+ <switch test="`$execute_failure`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <switch test="`$preload-data.preload-network-topology-information.route-table-reference_length`">
+ <outcome value=''>
+ <set>
+ <parameter name='preload-data.preload-network-topology-information.route-table-reference_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index="i" start="0" end="`$preload-data.preload-network-topology-information.route-table-reference_length`">
+ <switch test="`$preload-data.preload-network-topology-information.route-table-reference[$i].route-table-reference-fqdn != NULL`">
+ <outcome value='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="route-table-reference"
+ key="route-table-reference.route-table-reference-fqdn = $preload-data.preload-network-topology-information.route-table-reference[$i].route-table-reference-fqdn"
+ pfx="tmp.AnAI.route-table-reference">
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query network-policy n AnAI where network-policy-fqdn = ' + $preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'Failed to query network-policy n AnAI where network-policy-fqdn = ' + $preload-data.preload-network-topology-information.network-policy[$i].network-policy-fqdn`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="route-table-reference" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="route-table-reference.route-table-reference-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.AnAI.route-table-reference.route-table-reference-id`" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="`'An error occurred while saving l3-newtork route-table-reference relationship in AnAI where route-table-reference-id = ' + $tmp.AnAI.route-table-reference.route-table-reference-id`"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.route-table-reference.updated' value='1' />
+ </set>
+ </outcome>
+ </save>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$execute_failure`">
+ <outcome value='false'>
+ <switch test="`$tmp.l3networkUpdate == 1`">
+ <outcome value='true'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id" >
+ <parameter name="orchestration-status" value="PendingUpdate" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="An error occurred while updating l3-network.orchestration-status in AnAI"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.error-message" value="An error occurred while updating l3-network.orchestration-status in AnAI"/>
+ </set>
+ <return status='success'>
+ <parameter name='execute_failure' value='true' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.l3network.status.updated' value='1' />
+ </set>
+ </outcome>
+ </update>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test="`$execute_failure`">
+ <outcome value="true">
+ <block atomic='true'>
+ <set>
+ <parameter name='ROLLBACK_START' value='NETWORK_TOPOLOGY_CHANGEASSIGN' />
+ </set>
+ <for index="z" start="0" end="`$tmp.AnAI.l3network.relationship-list.relationship_length`">
+ <switch test="`$tmp.AnAI.l3network.relationship-list.relationship[$z].related-to`">
+ <outcome value='vpn-binding'>
+ <switch test="`$tmp.vpn-binding.updated == 1`">
+ <outcome value='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="vpn-binding" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="vpn-binding.vpn-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.AnAI.l3network.relationship-list.relationship[$z].relationship-data[0].relationship-value`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'An error occurred during rollback of l3-newtork vpn-binding relationship in AnAI where vpn-id = ' + $tmp.AnAI.l3network.relationship-list.relationship[$z].relationship-data[0].relationship-value + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'An error occurred during rollback of l3-newtork vpn-binding relationship in AnAI where vpn-id = ' + $tmp.AnAI.l3network.relationship-list.relationship[$z].relationship-data[0].relationship-value + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='network-policy'>
+ <switch test="`$tmp.network-policy.updated == 1`">
+ <outcome value='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="network-policy" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="network-policy.network-policy-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.AnAI.l3network.relationship-list.relationship[$z].relationship-data[0].relationship-value`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'An error occurred during rollback of l3-newtork network-policy relationship in AnAI where network-policy-id = ' + $tmp.AnAI.l3network.relationship-list.relationship[$z].relationship-data[0].relationship-value + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'An error occurred during rollback of l3-newtork network-policy relationship in AnAI where network-policy-id = ' + $tmp.AnAI.l3network.relationship-list.relationship[$z].relationship-data[0].relationship-value + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='route-table-reference'>
+ <switch test="`$tmp.route-table-reference.updated == 1`">
+ <outcome value='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network:relationship-list"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id" >
+ <parameter name="relationship-list.relationship[0].related-to" value="route-table-reference" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="route-table-reference.route-table-reference-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.AnAI.l3network.relationship-list.relationship[$z].relationship-data[0].relationship-value`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'An error occurred during rollback of l3-newtork route-table-reference relationship in AnAI where route-table-reference-id = ' + $tmp.AnAI.l3network.relationship-list.relationship[$z].relationship-data[0].relationship-value + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'An error occurred during rollback of l3-newtork route-table-reference relationship in AnAI where route-table-reference-id = ' + $tmp.AnAI.l3network.relationship-list.relationship[$z].relationship-data[0].relationship-value + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <for index="j" start="0" end="`$x`">
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.rollback.match" value="0"/>
+ </set>
+ <for index="i" start="0" end="`$tmp.AnAI.l3network.subnets.subnet_length`">
+ <switch test="`$tmp.AnAI.l3network.subnets.subnet[$i].subnet-id == $tmp.subnetRollback[$j].subnet-id`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <switch test="`$tmp.subnetRollback[$j].type`">
+ <outcome value='delete'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id
+ AND subnet.subnet-id = $tmp.subnetRollback[$j].subnet-id" >
+ <parameter name="orchestration-status" value="`$tmp.AnAI.l3network.subnets.subnet[$i].orchestration-status`" />
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'failed to rollback the subnet.orchestration-status in AnAI where subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$i].subnet-id + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'failed to rollback the subnet.orchestration-status in AnAI where subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$i].subnet-id + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ </update>
+ </outcome>
+ <outcome value='update'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id
+ AND subnet.subnet-id = $tmp.AnAI.l3network.subnets.subnet[$j].subnet-id" >
+ <parameter name="subnet-name" value="`$tmp.AnAI.l3network.subnets.subnet[$i].subnet-name`"/>
+ <parameter name="gateway-address" value="`$tmp.AnAI.l3network.subnets.subnet[$i].gateway-address`"/>
+ <parameter name="cidr-mask" value="`$tmp.AnAI.l3network.subnets.subnet[$i].cidr-mask`"/>
+ <parameter name="dhcp-start" value="`$tmp.AnAI.l3network.subnets.subnet[$i].dhcp-start`"/>
+ <parameter name="dhcp-end" value="`$tmp.AnAI.l3network.subnets.subnet[$i].dhcp-end`"/>
+ <parameter name="dhcp-enabled" value="`$tmp.AnAI.l3network.subnets.subnet[$i].dhcp-enabled`"/>
+ <parameter name="orchestration-status" value="`$tmp.AnAI.l3network.subnets.subnet[$i].orchestration-status`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'failed to rollback the subnet attributes update in AnAI where subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$i].subnet-id + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'failed to rollback the subnet attributes update in AnAI where subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$i].subnet-id + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ </update>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.rollback.match" value="1"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.rollback.match == 0`">
+ <outcome value='true'>
+ <switch test="`$tmp.subnetRollback[$j].type`">
+ <outcome value='create'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id
+ AND subnet.subnet-id = $tmp.subnetRollback[$j].subnet-id" >
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'failed to rollback to delete subnet from AnAI where subnet-id = ' + $tmp.subnetRollback[$j].subnet-id + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'failed to rollback to delete subnet from AnAI where subnet-id = ' + $tmp.subnetRollback[$j].subnet-id + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$tmp.l3network.status.updated == 1`">
+ <outcome value='true'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $tmp.AnAI.l3network.network-id" >
+ <parameter name="orchestration-status" value="`$tmp.AnAI.l3network.orchestration-status`" />
+ <outcome value='failure'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'failed to rollback l3network.orchestration-status in AnAI where subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$i].subnet-id + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name="error-code" value="500"/>
+ <parameter name="tmp.rollback.error-message" value="`'failed to rollback l3network.orchestration-status in AnAI where subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$i].subnet-id + ' MANUAL ROLLBACK IS REQUIRED.'`"/>
+ </set>
+ </outcome>
+ </update>
+ </outcome>
+ </switch>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'Error updating l3-network in AnAI with network-id = ' + $tmp.AnAI.l3network.network-id + ' - ' + $tmp.error-message + ' - ' + $tmp.rollback.error-message`"/>
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="ack-final" value="Y"/>
+ </set>
+ <return status="success">
+ <parameter name="networkId" value="`$network-topology-operation-input.network-request-information.network-id`" />
+ <parameter name="error-code" value="200" />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-deactivate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-deactivate.xml
index dc919889..54c8a750 100644
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-deactivate.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-deactivate.xml
@@ -1,81 +1,172 @@
-<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='network-topology-operation-deactivate' mode='sync'>
-<block atomic="true"><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+<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='network-topology-operation-deactivate' mode='sync'>
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="l3-network"
- key="l3-network.network-id = $network-topology-operation-input.network-information.network-id"
+ key="l3-network.network-id = $network-topology-operation-input.network-information.network-id
+ AND depth='all'"
local-only="false"
pfx="aai.l3-network">
-<outcome value='not-found'>
-<return status='failure'>
- <parameter name="error-code" value="404" />
- <parameter name="error-message" value="network-id not found in AAI" /></return></outcome><outcome value='failure'>
-<return status='failure'>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="'Error retrieving l3-network with network-id=' + $network-topology-operation-input.network-request-information.network-id + 'from AnAI'" /></return></outcome></get-resource><switch test='`$aai.l3-network.subnets.subnet_length`'>
-<outcome value=''>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="no networks found" />
-</return></outcome><outcome value='Other'>
-<for index='sidx' start='0' end='`$aai.l3-network.subnets.subnet_length`' >
-<block atomic="true"><get-resource
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="network-id not found in AAI" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="'Error retrieving l3-network with network-id=' + $network-topology-operation-input.network-request-information.network-id + 'from AnAI'" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test='`$aai.l3-network.subnets.subnet_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="no networks found" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$network-data.network-topology.network-topology-identifier-structure.network-instance-group-id`'>
+ <outcome value=''>
+ <switch test='`$service-data.networks.network[$nidx].network-data.network-information.from-preload`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <for index='sidx' start='0' end='`$aai.l3-network.subnets.subnet_length`' >
+ <block atomic="true">
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $aai.l3-network.network-id
+ AND subnet.subnet-id = $aai.l3-network.subnets.subnet[$sidx].subnet-id" >
+ <parameter name="orchestration-status" value="PendingDelete" />
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet. Subnet not found." />
+ </return>
+ </outcome>
+ </update>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='sidx' start='0' end='`$aai.l3-network.subnets.subnet_length`' >
+ <block atomic="true">
+ <get-resource
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="SELECT * from EIPAM_IP_SUBNETS where entity_id = $aai.l3-network.subnets.subnet[$sidx].subnet-id ; "
pfx='tmp.eipam-subnet-row'>
-
-<outcome value='failure'>
-<return status="failure">
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNETS failed to find subnet matching aai subnet." />
- </return></outcome><outcome value="not-found"><return status="failure">
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Subnet not found in EIPAM_IP_SUBNETS - deactivate failed." />
- </return></outcome><outcome value='success'>
-<block atomic='true'><set>
- <parameter name="eipam-ip-block.entity-id" value="`$aai.l3-network.subnets.subnet[$sidx].subnet-id`"/>
- <parameter name="eipam-ip-block.plans[0].plan-name" value="$tmp.eipam-subnet-row.plan-name"/>
-</set></block></outcome></get-resource><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNETS failed to find subnet matching aai subnet." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Subnet not found in EIPAM_IP_SUBNETS - deactivate failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <set>
+ <parameter name="eipam-ip-block.entity-id" value="`$aai.l3-network.subnets.subnet[$sidx].subnet-id`"/>
+ <parameter name="eipam-ip-block.plans[0].plan-name" value="$tmp.eipam-subnet-row.plan-name"/>
+ </set>
+ </block>
+ </outcome>
+ </get-resource>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="subnet"
key="l3-network.network-id = $aai.l3-network.network-id
AND subnet.subnet-id = $eipam-ip-block.entity-id" >
-<parameter name="orchestration-status" value="PendingDelete" />
- <outcome value='failure'>
-<return status="failure">
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet." />
- </return></outcome><outcome value="not-found"><return status="failure">
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet. Subnet not found." />
- </return></outcome></update></block></for></outcome></switch><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ <parameter name="orchestration-status" value="PendingDelete" />
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet. Subnet not found." />
+ </return>
+ </outcome>
+ </update>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network collection activate failed" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="l3-network"
key="l3-network.network-id = $aai.l3-network.network-id" >
-<parameter name="orchestration-status" value="PendingDelete" />
- <outcome value='failure'>
-<return status="failure">
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Failure updating orchestration-status in AAI for l3-network" />
- </return></outcome><outcome value="not-found"><return status="failure">
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Failure updating orchestration-status in AAI for l3-network. Network not found." />
- </return></outcome></update><set>
-<parameter name='service-data.networks.network[$nidx].network-data.sdnc-request-header.' value='`$network-topology-operation-input.sdnc-request-header.`' />
-<parameter name='service-data.networks.network[$nidx].network-data.request-information.' value='`$network-topology-operation-input.request-information.`' />
-</set><set>
-<parameter name='networkId' value='`$network-topology-operation-input.network-information.network-id`' />
-</set><set>
-<parameter name='network-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ <parameter name="orchestration-status" value="PendingDelete" />
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for l3-network" />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for l3-network. Network not found." />
+ </return>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.sdnc-request-header.' value='`$network-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.request-information.' value='`$network-topology-operation-input.request-information.`' />
+ </set>
+ <set>
+ <parameter name='networkId' value='`$network-topology-operation-input.network-information.network-id`' />
+ </set>
+ <set>
+ <parameter name='network-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ $network-topology-operation-input.service-information.service-instance-id
+ '/service-data/networks/network/'
+ $networkId
+ '/network-data/network-topology/'` " />
-
-</set><set>
-<parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status' value='PendingDelete' />
-<parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.last-rpc-action' value='`$network-topology-operation-input.sdnc-request-header.svc-action`' />
-<parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.last-action' value='`$network-topology-operation-input.request-information.request-action`' />
-</set><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>
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status' value='PendingDelete' />
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.last-rpc-action' value='`$network-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.last-action' value='`$network-topology-operation-input.request-information.request-action`' />
+ </set>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-unassign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-unassign.xml
index b987c540..0ae9fa76 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-unassign.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-unassign.xml
@@ -1,74 +1,147 @@
-<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='network-topology-operation-unassign' mode='sync'>
-<block atomic="true"><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+<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='network-topology-operation-unassign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$service-data.networks.network[$nidx].network-data.network-information.from-preload`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $network-topology-operation-input.network-information.network-id"
+ local-only="false"
+ pfx="aai.l3-network">
+ <outcome value='success'>
+ <block atomic="true">
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $network-topology-operation-input.network-information.network-id">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while deleting network from AAI" />
+ </return>
+ </outcome>
+ </delete>
+ </block>
+ </outcome>
+ <outcome value='not-found'></outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="'Error retrieving l3-network with network-id=' + $network-topology-operation-input.network-request-information.network-id + 'from AnAI'" />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$network-data.network-topology.network-topology-identifier-structure.network-instance-group-id`'>
+ <outcome value=''>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key='SELECT * from NETWORK_MODEL WHERE customization_uuid = $service-data.networks.network[$nidx].network-data.network-information.onap-model-information.model-customization-uuid
and service_uuid = $service-data.networks.network[$nidx].network-data.service-information.onap-model-information.model-uuid'
- pfx='network-model'>
-
-</get-resource><set>
- <parameter name="tmp.level1-key-value" value=""/>
- <parameter name="tmp.level1inuse" value="false" />
- <parameter name="pidx" value="0" />
- <parameter name="pidx-len" value="0" />
-
-</set><get-resource
+ pfx='network-model'></get-resource>
+ <set>
+ <parameter name="tmp.level1-key-value" value=""/>
+ <parameter name="tmp.level1inuse" value="false" />
+ <parameter name="pidx" value="0" />
+ <parameter name="pidx-len" value="0" />
+ </set>
+ <get-resource
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="SELECT * from EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k WHERE s.network_id = $network-topology-operation-input.network-information.network-id and s.entity_id = k.entity_id ; "
pfx='tmp.eipam-subnet-row[]'>
-
-<outcome value='failure'>
-<return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
- </return></outcome><outcome value='success'>
-<block atomic='true'><for silentFailure='true' index='esidx' start='0' end='`$tmp.eipam-subnet-row_length`' >
-<block atomic="true"><switch test='`$tmp.eipam-subnet-row[$esidx].level`'>
-<outcome value='1'>
-<block atomic="true"><set>
- <parameter name="tmp.level1-key-value[$pidx]" value="`$tmp.eipam-subnet-row[$esidx].key-value`"/>
-
-
-</set><set>
- <parameter name="tmp.plan-name[$pidx]" value="`$tmp.eipam-subnet-row[$esidx].plan-name`"/>
-
-
-</set><set>
- <parameter name="pidx" value="`$pidx + 1`"/>
-
-
-</set><set>
- <parameter name="pidx-len" value="`$pidx`"/>
-
-
-</set></block></outcome><outcome value='Other'>
-<block atomic="true"></block></outcome></switch></block></for></block></outcome><outcome value="not-found"><block atomic='true'></block></outcome></get-resource><set>
- <parameter name="eipam-ip-block.network-id" value="`$network-topology-operation-input.network-information.network-id`" />
- <parameter name="eipam-ip-block.level" value='2' />
- <parameter name="eipam-ip-block.entity-id" value='' /></set><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deallocateAllSubnets">
-<outcome value='failure'><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while deallocating subnets in EIPAM." />
- </return></outcome></execute><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
-<outcome value='failure'><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while deleting level 2 plans in EIPAM." />
- </return></outcome></execute><for silentFailure='true' index='npidx' start='0' end='`$pidx-len`' >
-<block atomic="true"><set>
- <parameter name="tmp.level1-key-value" value="`$tmp.level1-key-value[$npidx]`" />
- <parameter name="tmp.plan-name" value="`$tmp.plan-name[$npidx]`" />
-
-</set><switch test='`$tmp.level1-key-value`'>
-<outcome value=''>
-<block atomic='true'></block></outcome><outcome value='Other'>
-<block atomic='true'><switch test='`$network-model`'>
-<outcome value=''></outcome><outcome value='Other'>
-<block atomic='true'><switch test="`$network-model.use-ipv4`"><outcome value='Y'><block atomic="true"><set>
-<parameter name='tmp.plan-name' value='`$network-model.eipam-v4-address-plan`' />
-
-</set><get-resource
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <for silentFailure='true' index='esidx' start='0' end='`$tmp.eipam-subnet-row_length`' >
+ <block atomic="true">
+ <switch test='`$tmp.eipam-subnet-row[$esidx].level`'>
+ <outcome value='1'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.level1-key-value[$pidx]" value="`$tmp.eipam-subnet-row[$esidx].key-value`"/>
+ </set>
+ <set>
+ <parameter name="tmp.plan-name[$pidx]" value="`$tmp.eipam-subnet-row[$esidx].plan-name`"/>
+ </set>
+ <set>
+ <parameter name="pidx" value="`$pidx + 1`"/>
+ </set>
+ <set>
+ <parameter name="pidx-len" value="`$pidx`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true"></block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'></block>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name="eipam-ip-block.network-id" value="`$network-topology-operation-input.network-information.network-id`" />
+ <parameter name="eipam-ip-block.level" value='2' />
+ <parameter name="eipam-ip-block.entity-id" value='' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deallocateAllSubnets">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while deallocating subnets in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByNetworkLevel">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while deleting level 2 plans in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <for silentFailure='true' index='npidx' start='0' end='`$pidx-len`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.level1-key-value" value="`$tmp.level1-key-value[$npidx]`" />
+ <parameter name="tmp.plan-name" value="`$tmp.plan-name[$npidx]`" />
+ </set>
+ <switch test='`$tmp.level1-key-value`'>
+ <outcome value=''>
+ <block atomic='true'></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <switch test='`$network-model`'>
+ <outcome value=''></outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='Y'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.plan-name' value='`$network-model.eipam-v4-address-plan`' />
+ </set>
+ <get-resource
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="SELECT * from EIPAM_IP_POOLS p, EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k
@@ -78,19 +151,23 @@
and p.pool_id = s.pool_id and s.entity_id = k.entity_id
and k.key_value = $tmp.level1-key-value ; "
pfx='tmp.level2pool[]'>
-
-
-
-<outcome value='failure'>
-<return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
- </return></outcome><outcome value='success'>
-<block atomic='true'><set>
- <parameter name="tmp.level1inuse" value="true" />
-
-</set></block></outcome><outcome value="not-found"><block atomic='true'><get-resource
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.level1inuse" value="true" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'>
+ <get-resource
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="SELECT * from EIPAM_IP_POOLS p, EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k
@@ -100,36 +177,66 @@
and p.pool_id = s.pool_id and s.entity_id = k.entity_id
and k.key_value = $tmp.level1-key-value ; "
pfx='tmp.level1pool[]'>
-
-<outcome value='failure'>
-<return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
- </return></outcome><outcome value='success'>
-<block atomic='true'><for silentFailure='true' index='lidx' start='0' end='`$tmp.level1pool_length`' >
-<block atomic='true'><set>
-<parameter name='eipam-ip-block.entity-id' value='`$tmp.level1pool[$lidx].entity-id`' />
-<parameter name='eipam-ip-block.ip-address' value='`$tmp.level1pool[$lidx].ip-address`' />
-<parameter name='eipam-ip-block.mask' value='`$tmp.level1pool[$lidx].prefix-length`' />
-<parameter name="eipam-ip-block.network-id" value="`$tmp.level1pool[$lidx].network-id`" />
-<parameter name="eipam-ip-block.pool-id" value="`$tmp.level1pool[$lidx].pool-id`" />
-<parameter name="eipam-ip-block.level" value='1' />
-
-</set><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deallocateSubnet">
-<outcome value='failure'><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while deallocating subnet in EIPAM." />
- </return></outcome></execute><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByPoolId">
-<outcome value='failure'><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while deleting pool in EIPAM." />
- </return></outcome></execute></block></for></block></outcome><outcome value="not-found"><block atomic='true'></block></outcome></get-resource></block></outcome></get-resource></block></outcome></switch><switch test="`$network-model.use-ipv6`"><outcome value='Y'><block atomic="true"><set>
-<parameter name='tmp.plan-name' value='`$network-model.eipam-v6-address-plan`' />
-
-</set><get-resource
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <for silentFailure='true' index='lidx' start='0' end='`$tmp.level1pool_length`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.entity-id' value='`$tmp.level1pool[$lidx].entity-id`' />
+ <parameter name='eipam-ip-block.ip-address' value='`$tmp.level1pool[$lidx].ip-address`' />
+ <parameter name='eipam-ip-block.mask' value='`$tmp.level1pool[$lidx].prefix-length`' />
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.level1pool[$lidx].network-id`" />
+ <parameter name="eipam-ip-block.pool-id" value="`$tmp.level1pool[$lidx].pool-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deallocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while deallocating subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByPoolId">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while deleting pool in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'></block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='Y'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.plan-name' value='`$network-model.eipam-v6-address-plan`' />
+ </set>
+ <get-resource
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="SELECT * from EIPAM_IP_POOLS p, EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k
@@ -139,19 +246,23 @@
and p.pool_id = s.pool_id and s.entity_id = k.entity_id
and k.key_value = $tmp.level1-key-value ; "
pfx='tmp.level2pool[]'>
-
-
-
-<outcome value='failure'>
-<return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
- </return></outcome><outcome value='success'>
-<block atomic='true'><set>
- <parameter name="tmp.level1inuse" value="true" />
-
-</set></block></outcome><outcome value="not-found"><block atomic='true'><get-resource
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.level1inuse" value="true" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'>
+ <get-resource
plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key="SELECT * from EIPAM_IP_POOLS p, EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k
@@ -161,69 +272,172 @@
and p.pool_id = s.pool_id and s.entity_id = k.entity_id
and k.key_value = $tmp.level1-key-value ; "
pfx='tmp.level1pool[]'>
-
-<outcome value='failure'>
-<return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
- </return></outcome><outcome value='success'>
-<block atomic='true'><for silentFailure='true' index='lidx' start='0' end='`$tmp.level1pool_length`' >
-<block atomic='true'><set>
-<parameter name='eipam-ip-block.entity-id' value='`$tmp.level1pool[$lidx].entity-id`' />
-<parameter name='eipam-ip-block.ip-address' value='`$tmp.level1pool[$lidx].ip-address`' />
-<parameter name='eipam-ip-block.mask' value='`$tmp.level1pool[$lidx].prefix-length`' />
-<parameter name="eipam-ip-block.network-id" value="`$tmp.level1pool[$lidx].network-id`" />
-<parameter name="eipam-ip-block.pool-id" value="`$tmp.level1pool[$lidx].pool-id`" />
-<parameter name="eipam-ip-block.level" value='1' />
-
-</set><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deallocateSubnet">
-<outcome value='failure'><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while deallocating subnet in EIPAM." />
- </return></outcome></execute><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByPoolId">
-<outcome value='failure'><return status="failure">
- <parameter name="tmp.eipam-error" value="true" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while deleting pool in EIPAM." />
- </return></outcome></execute></block></for></block></outcome><outcome value="not-found"><block atomic='true'></block></outcome></get-resource></block></outcome></get-resource></block></outcome></switch></block></outcome></switch></block></outcome></switch></block></for><switch test='`$service-data.networks.network_length`'>
-<outcome value='1'>
-<block atomic="true"><set>
- <parameter name="service-data.networks." value=""/>
-
-</set><set>
- <parameter name="service-data.networks.network_length" value="0"/>
-
-
-</set></block></outcome><outcome value='Other'>
-<block atomic="true"><set>
- <parameter name="tmp.new_length" value="`$service-data.networks.network_length - 1`"/>
-
-
-</set><for silentFailure='true' index='snidx' start='`$tmp.nidx + 1`' end='`$service-data.networks.network_length`' >
-<block atomic="true"><set>
- <parameter name="tmp.newidx" value="`$snidx - 1`"/>
-
-
-</set><set>
- <parameter name="service-data.networks.network[$tmp.newidx]." value="$service-data.networks.network[$snidx]." />
-
-</set></block></for><set>
- <parameter name="service-data.networks.network_length" value="`$service-data.networks.network_length - 1`"/>
-
-
-</set><set>
- <parameter name="service-data.networks.network[$tmp.new_length]." value=""/>
-
-</set></block></outcome></switch><delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <for silentFailure='true' index='lidx' start='0' end='`$tmp.level1pool_length`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.entity-id' value='`$tmp.level1pool[$lidx].entity-id`' />
+ <parameter name='eipam-ip-block.ip-address' value='`$tmp.level1pool[$lidx].ip-address`' />
+ <parameter name='eipam-ip-block.mask' value='`$tmp.level1pool[$lidx].prefix-length`' />
+ <parameter name="eipam-ip-block.network-id" value="`$tmp.level1pool[$lidx].network-id`" />
+ <parameter name="eipam-ip-block.pool-id" value="`$tmp.level1pool[$lidx].pool-id`" />
+ <parameter name="eipam-ip-block.level" value='1' />
+ </set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deallocateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while deallocating subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePoolByPoolId">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while deleting pool in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'></block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value='1'>
+ <block atomic="true">
+ <set>
+ <parameter name="service-data.networks." value=""/>
+ </set>
+ <set>
+ <parameter name="service-data.networks.network_length" value="0"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.new_length" value="`$service-data.networks.network_length - 1`"/>
+ </set>
+ <for silentFailure='true' index='snidx' start='`$tmp.nidx + 1`' end='`$service-data.networks.network_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.newidx" value="`$snidx - 1`"/>
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$tmp.newidx]." value="$service-data.networks.network[$snidx]." />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name="service-data.networks.network_length" value="`$service-data.networks.network_length - 1`"/>
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$tmp.new_length]." value=""/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="l3-network"
- key="l3-network.network-id = $network-topology-operation-input.network-information.network-id"><outcome value='failure'>
-<return status="failure">
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while deleting network from AAI" />
- </return></outcome></delete><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>
+ key="l3-network.network-id = $network-topology-operation-input.network-information.network-id">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while deleting network from AAI" />
+ </return>
+ </outcome>
+ </delete>
+ <set>
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$network-topology-operation-input.network-information.network-id`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='NETWORK' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network collection activate failed" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value='1'>
+ <block atomic="true">
+ <set>
+ <parameter name="service-data.networks." value=""/>
+ </set>
+ <set>
+ <parameter name="service-data.networks.network_length" value="0"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.new_length" value="`$service-data.networks.network_length - 1`"/>
+ </set>
+ <for silentFailure='true' index='snidx' start='`$tmp.nidx + 1`' end='`$service-data.networks.network_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.newidx" value="`$snidx - 1`"/>
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$tmp.newidx]." value="$service-data.networks.network[$snidx]." />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name="service-data.networks.network_length" value="`$service-data.networks.network_length - 1`"/>
+ </set>
+ <set>
+ <parameter name="service-data.networks.network[$tmp.new_length]." value=""/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation.xml
index f7782fb8..7623a91f 100644
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation.xml
@@ -7,76 +7,57 @@
<switch test='`$network-topology-operation-input.sdnc-request-header.svc-action`'>
<outcome value='assign'>
<block atomic="true">
- <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-assign' mode='sync' ></call>
+ <switch test='`$service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`'>
+ <outcome value='Created'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Network is not in appropriate state for assign. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`" />
+ </return>
+ </outcome>
+ <outcome value='PendingDelete'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Network is not in appropriate state for assign. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`" />
+ </return>
+ </outcome>
+ <outcome value='PendingCreate'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Network is not in appropriate state for assign. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-assign' mode='sync' ></call>
+ </outcome>
+ </switch>
</block>
</outcome>
<outcome value='activate'>
- <switch test='`$network-topology-operation-input.request-information.request-action`'>
- <outcome value='ActivateSOTNConnectivityInstance'>
- <call module='GENERIC-RESOURCE-API' rpc='sotn-network-topology-operation-activate' mode='sync' ></call>
- </outcome>
- <outcome value='ActivateDCINetworkInstance'>
- <call module='GENERIC-RESOURCE-API' rpc='dci-connects-network-topology-operation-activate' mode='sync' ></call>
- </outcome>
- <outcome value='other'>
- <block atomic="true">
- <switch test='`$service-data.networks.network_length`'>
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" />
- </return>
- </outcome>
- <outcome value='Other'>
- <block atomic="true">
- <for index='nidx' start='0' end='`$service-data.networks.network_length`' >
- <switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`">
- <outcome value='true'>
- <set>
- <parameter name='tmp.nidx' value='`$nidx`' />
- <parameter name='ctx.network-data.' value='`$service-data.networks.network[$nidx].`' />
- </set>
- </outcome>
- </switch>
- </for>
- <switch test="`$tmp.nidx`">
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" />
- </return>
- </outcome>
- </switch>
- </block>
- </outcome>
- </switch>
- <switch test='`$service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`'>
- <outcome value='PendingCreate'>
- <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-activate' mode='sync' ></call>
- </outcome>
- <outcome value='Other'>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'Network is not in appropriate state for activate. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`" />
- </return>
- </outcome>
- </switch>
- </block>
- </outcome>
- </switch>
- </outcome>
- <outcome value='deactivate'>
<block atomic="true">
- <switch test='`$network-topology-operation-input.request-information.request-action`'>
- <outcome value='DeactivateSOTNConnectivityInstance'>
- <call module='GENERIC-RESOURCE-API' rpc='sotn-network-topology-operation-deactivate' mode='sync' ></call>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" />
+ </return>
</outcome>
<outcome value='Other'>
<block atomic="true">
- <switch test='`$service-data.networks.network_length`'>
+ <for index='nidx' start='0' end='`$service-data.networks.network_length`' >
+ <switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`">
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.nidx' value='`$nidx`' />
+ <parameter name='network-data.' value='`$service-data.networks.network[$nidx].`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.nidx`">
<outcome value=''>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
@@ -85,51 +66,182 @@
</return>
</outcome>
<outcome value='Other'>
+ <set>
+ <parameter name='nidx' value='`$tmp.nidx`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.network-instance-group-id`'>
+ <outcome value=''>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <switch test='`$service-data.network-instance-groups.network-instance-group_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-instance-group-id not found in service-data" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
<block atomic="true">
- <for index='nidx' start='0' end='`$service-data.networks.network_length`' >
- <switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`">
+ <for index='ngidx' start='0' end='`$service-data.network-instance-groups.network-instance-_length`' >
+ <switch test="`$service-data.network-instance-groups.network-instance-group[$nidx].network-instance-group-id == $network-topology-operation-input.network-information.network-instance-group-id`">
<outcome value='true'>
- <set>
- <parameter name='tmp.nidx' value='`$nidx`' />
- <parameter name='ctx.network-data.' value='`$service-data.networks.network[$nidx].`' />
- </set>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ngidx' value='`$ngidx`' />
+ <parameter name='ctx.network-instance-group-data.' value='`$service-data.network-instance-groups.network-instance-group[$ngidx].`' />
+ </set>
+ </block>
</outcome>
</switch>
</for>
- <switch test="`$tmp.nidx`">
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" />
- </return>
- </outcome>
- </switch>
</block>
</outcome>
</switch>
- <switch test='`$service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`'>
- <outcome value='Created'>
- <switch test='`$network-topology-operation-input.request-information.request-action`'>
- <outcome value='DeActivateDCINetworkInstance'>
- <call module='GENERIC-RESOURCE-API' rpc='dci-connects-network-topology-operation-deactivate' mode='sync' ></call>
- </outcome>
- <outcome value='Other'>
- <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-deactivate' mode='sync' ></call>
- </outcome>
- </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`'>
+ <outcome value='PendingCreate'>
+ <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Network is not in appropriate state for activate. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='changeassign'>
+ <block atomic="true">
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='nidx' start='0' end='`$service-data.networks.network_length`' >
+ <switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`">
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.nidx' value='`$nidx`' />
+ <parameter name='network-data.' value='`$service-data.networks.network[$nidx].`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.nidx`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" />
+ </return>
</outcome>
<outcome value='Other'>
+ <set>
+ <parameter name='nidx' value='`$tmp.nidx`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-changeassign' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='deactivate'>
+ <block atomic="true">
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='nidx' start='0' end='`$service-data.networks.network_length`' >
+ <switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`">
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.nidx' value='`$nidx`' />
+ <parameter name='network-data.' value='`$service-data.networks.network[$nidx].`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.nidx`">
+ <outcome value=''>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'Network is not in appropriate state for deactivate. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`" />
+ <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" />
</return>
</outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='nidx' value='`$tmp.nidx`' />
+ </set>
+ </outcome>
</switch>
</block>
</outcome>
</switch>
+ <switch test='`$network-topology-operation-input.network-information.network-instance-group-id`'>
+ <outcome value=''>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <switch test='`$service-data.network-instance-groups.network-instance-group_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-instance-group-id not found in service-data" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='ngidx' start='0' end='`$service-data.network-instance-groups.network-instance-_length`' >
+ <switch test="`$service-data.network-instance-groups.network-instance-group[$nidx].network-instance-group-id == $network-topology-operation-input.network-information.network-instance-group-id`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ngidx' value='`$ngidx`' />
+ <parameter name='ctx.network-instance-group-data.' value='`$service-data.network-instance-groups.network-instance-group[$ngidx].`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-deactivate' mode='sync' ></call>
</block>
</outcome>
<outcome value='unassign'>
@@ -149,7 +261,7 @@
<outcome value='true'>
<set>
<parameter name='tmp.nidx' value='`$nidx`' />
- <parameter name='ctx.network-data.' value='`$service-data.networks.network[$nidx].`' />
+ <parameter name='network-data.' value='`$service-data.networks.network[$nidx].`' />
</set>
</outcome>
</switch>
@@ -162,6 +274,47 @@
<parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" />
</return>
</outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='nidx' value='`$tmp.nidx`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.network-instance-group-id`'>
+ <outcome value=''>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <switch test='`$service-data.network-instance-groups.network-instance-group_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-instance-group-id not found in service-data" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='ngidx' start='0' end='`$service-data.network-instance-groups.network-instance-_length`' >
+ <switch test="`$service-data.network-instance-groups.network-instance-group[$nidx].network-instance-group-id == $network-topology-operation-input.network-information.network-instance-group-id`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ngidx' value='`$ngidx`' />
+ <parameter name='ctx.network-instance-group-data.' value='`$service-data.network-instance-groups.network-instance-group[$ngidx].`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
</switch>
</block>
</outcome>
@@ -190,30 +343,6 @@
<parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
</return>
</outcome>
- <outcome value='create'>
- <switch test='`$network-topology-operation-input.request-information.request-action`'>
- <outcome value='CreateSOTNConnectivityInstance'>
- <call module='GENERIC-RESOURCE-API' rpc='sotn-network-topology-operation-create' mode='sync' ></call>
- </outcome>
- <outcome value='other'>
- <block atomic="true">
- <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-create' mode='sync' ></call>
- </block>
- </outcome>
- </switch>
- </outcome>
- <outcome value='delete'>
- <switch test='`$network-topology-operation-input.request-information.request-action`'>
- <outcome value='DeleteSOTNConnectivityInstance'>
- <call module='GENERIC-RESOURCE-API' rpc='sotn-network-topology-operation-delete' mode='sync' ></call>
- </outcome>
- <outcome value='other'>
- <block atomic="true">
- <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-delete' mode='sync' ></call>
- </block>
- </outcome>
- </switch>
- </outcome>
</switch>
<set>
<parameter name="ack-final" value="Y"/>
@@ -225,4 +354,4 @@
</return>
</block>
</method>
-</service-logic>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_policy-manager-create-policy.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_policy-manager-create-policy.xml
index 50b71864..c6d45de2 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_policy-manager-create-policy.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_policy-manager-create-policy.xml
@@ -1,31 +1,46 @@
-<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='policy-manager-create-policy' mode='sync'>
-<block atomic="true"><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.createpolicy.templatefile`" />
- <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/createPolicy'`" />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='PUT' />
- <parameter name='convertResponse' value="false" />
- <parameter name='customHttpHeaders'
- value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" />
-<outcome value='success'>
-<block atomic="true">
-<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.pushpolicy.templatefile`" />
- <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/pushPolicy'`" />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='PUT' />
- <parameter name='convertResponse' value="false" />
- <parameter name='customHttpHeaders'
- value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" />
-<outcome value='success'>
-<block atomic="true">
-</block></outcome><outcome value='Other'>
-<return status='failure'>
-<parameter name='error-code' value='500' />
-<parameter name='error-message' value='Failed to push policy in Policy Manager' />
-</return></outcome></execute></block></outcome><outcome value='Other'>
-<return status='failure'>
-<parameter name='error-code' value='500' />
-<parameter name='error-message' value='Failed to create policy in Policy Manager' />
-</return></outcome></execute><return status='success'>
-</return></block></method></service-logic>
+<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='policy-manager-create-policy' mode='sync'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.createpolicy.templatefile`" />
+ <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/createPolicy'`" />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name='convertResponse' value="false" />
+ <parameter name='customHttpHeaders'
+ value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" />
+ <outcome value='success'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.pushpolicy.templatefile`" />
+ <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/pushPolicy'`" />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name='convertResponse' value="false" />
+ <parameter name='customHttpHeaders'
+ value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" />
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Failed to push policy in Policy Manager' />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Failed to create policy in Policy Manager' />
+ </return>
+ </outcome>
+ </execute>
+ <return status='success'></return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_policy-manager-delete-policy.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_policy-manager-delete-policy.xml
index 9b859332..e5bcb096 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_policy-manager-delete-policy.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_policy-manager-delete-policy.xml
@@ -1,31 +1,46 @@
-<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='policy-manager-delete-policy' mode='sync'>
-<block atomic="true"><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.deletepolicypdp.templatefile`" />
- <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/deletePolicy'`" />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='DELETE' />
- <parameter name='convertResponse' value="false" />
- <parameter name='customHttpHeaders'
- value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" />
-<outcome value='success'>
-<block atomic="true">
-<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.deletepolicypap.templatefile`" />
- <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/deletePolicy'`" />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='DELETE' />
- <parameter name='convertResponse' value="false" />
- <parameter name='customHttpHeaders'
- value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" />
-<outcome value='success'>
-<block atomic="true">
-</block></outcome><outcome value='Other'>
-<return status='failure'>
-<parameter name='error-code' value='500' />
-<parameter name='error-message' value='Failed to delete policy from Policy Manager (PAP)' />
-</return></outcome></execute></block></outcome><outcome value='Other'>
-<return status='failure'>
-<parameter name='error-code' value='500' />
-<parameter name='error-message' value='Failed to delete policy from Policy Manager (PDP)' />
-</return></outcome></execute><return status='success'>
-</return></block></method></service-logic>
+<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='policy-manager-delete-policy' mode='sync'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.deletepolicypdp.templatefile`" />
+ <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/deletePolicy'`" />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name='convertResponse' value="false" />
+ <parameter name='customHttpHeaders'
+ value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" />
+ <outcome value='success'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.deletepolicypap.templatefile`" />
+ <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/deletePolicy'`" />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name='convertResponse' value="false" />
+ <parameter name='customHttpHeaders'
+ value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" />
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Failed to delete policy from Policy Manager (PAP)' />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Failed to delete policy from Policy Manager (PDP)' />
+ </return>
+ </outcome>
+ </execute>
+ <return status='success'></return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_policy-update-notify-operation.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_policy-update-notify-operation.xml
index c1b4ccde..a0d77fda 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_policy-update-notify-operation.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_policy-update-notify-operation.xml
@@ -1,42 +1,89 @@
-<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='policy-update-notify-operation' mode='sync'>
-<block atomic="true"><switch test='`$policy-update-notify-operation-input.update-type`'>
-<outcome value='Update'>
-<block atomic="true"><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
- <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
- <parameter name='contextPrefix' value='prop' />
-</execute><set>
-<parameter name='tmp.sql' value="`'insert into POLICY_UPDATE_NOTIFICATION (policy_name,version_id,update_type) values ( '
-+ ' $policy-update-notify-operation-input.policy-name , $policy-update-notify-operation-input.version-id , $policy-update-notify-operation-input.update-type )'`" />
-
-</set><save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key="`$tmp.sql`" pfx='pfx'>
-</save><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.getpolicy.templatefile`" />
- <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/getConfig'`" />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='POST' />
- <parameter name='responsePrefix' value="policy" />
- <parameter name='customHttpHeaders'
- value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" />
-<outcome value='success'>
-<block atomic="true">
-</block></outcome><outcome value='Other'>
-<return status='failure'>
-<parameter name='error-code' value='500' />
-<parameter name='error-message' value='Failed to get policy from Policy Manager' />
-</return></outcome></execute><execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
-<parameter name='api-name' value='network-policy' />
-<parameter name='api-action' value='update' />
-<parameter name='resp-prefix' value='contrailResp' />
-<parameter name='cloud-region-id' value='`$cloud-region-id`' />
-<parameter name='update-network-policy-json' value='`$policy.config`' /><outcome value='success'>
-<block atomic="true">
-</block></outcome><outcome value='Other'>
-<return status='failure'>
-<parameter name='error-code' value='500' />
-<parameter name='error-message' value='Failed to get policy from Policy Manager' />
-</return></outcome></execute></block></outcome></switch><return status='success'>
-<parameter name="ack-final-indicator" value="Y" />
-<parameter name="error-code" value="200" />
-<parameter name="error-message" value="success" />
-</return></block></method></service-logic>
+<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='policy-update-notify-operation' mode='sync'>
+ <block atomic="true">
+ <switch test='`$policy-update-notify-operation-input.update-type`'>
+ <outcome value='Update'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <set>
+ <parameter name='tmp.sql' value="`'insert into POLICY_UPDATE_NOTIFICATION (policy_name,version_id,update_type) values ( '
++ ' $policy-update-notify-operation-input.policy-name , $policy-update-notify-operation-input.version-id , $policy-update-notify-operation-input.update-type )'`" />
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.sql`" pfx='pfx'></save>
+ <set>
+ <parameter name='tmp.policy-name' value='`$policy-update-notify-operation-input.policy-name`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.getpolicy.templatefile`" />
+ <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/getConfig'`" />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name='responsePrefix' value="policy" />
+ <parameter name='customHttpHeaders'
+ value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" />
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Failed to get policy from Policy Manager' />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='jsonStringToCtx' >
+ <parameter name='source' value="policy.config" />
+ <parameter name='outputPath' value="tmp.config-ctx" />
+ <parameter name='isEscaped' value='false' />
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Failed to convert config variable from PolicyManager' />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='policy-name' value='`$tmp.config-ctx.content.fq_name[2]`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$policy-name`" />
+ <parameter name="regex" value="_"/>
+ <parameter name="limit" value="3" />
+ <parameter name="ctx_memory_result_key" value="policy-splits" />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='network-policy' />
+ <parameter name='api-action' value='update' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='cloud-region-id' value='`$policy-splits[1]`' />
+ <parameter name='update-network-policy-json' value='`$policy.config`' />
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Error updating Contrail: ' + $contrailResp.resp-message`" />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="success" />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-get-policy.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-get-policy.xml
new file mode 100644
index 00000000..a5e7438d
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-get-policy.xml
@@ -0,0 +1,113 @@
+<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='port-mirror-get-policy' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.policy-name' value='`$db.cap[0].policy-name`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.getpolicy.templatefile`" />
+ <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/getConfig'`" />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='POST' />
+ <parameter name='responsePrefix' value="policy" />
+ <parameter name='customHttpHeaders'
+ value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" />
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Failed to get policy from Policy Manager' />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='jsonStringToCtx' >
+ <parameter name='source' value="policy.config" />
+ <parameter name='outputPath' value="tmp.config-ctx" />
+ <parameter name='isEscaped' value='false' />
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Failed to convert config variable from PolicyManager' />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="toLower">
+ <parameter name="source" value="`$tmp.tenant-context`" />
+ <parameter name="outputPath" value="tmp.lc-tenant-context" />
+ </execute>
+ <switch test='`$tmp.lc-tenant-context`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.dest-p-interface' value='`$tmp.config-ctx.content.defaultContext`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome='true'>
+ <parameter name="source" value="`$tmp.lc-tenant-context`" />
+ <parameter name="target" value="prod" />
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.dest-p-interface' value='`$tmp.config-ctx.content.productionContext`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome='true'>
+ <parameter name="source" value="`$tmp.lc-tenant-context`" />
+ <parameter name="target" value="test" />
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.dest-p-interface' value='`$tmp.config-ctx.content.testContext`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome='true'>
+ <parameter name="source" value="`$tmp.lc-tenant-context`" />
+ <parameter name="target" value="dev" />
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.dest-p-interface' value='`$tmp.config-ctx.content.developmentContext`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome='true'>
+ <parameter name="source" value="`$tmp.lc-tenant-context`" />
+ <parameter name="target" value="default" />
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.dest-p-interface' value='`$tmp.config-ctx.content.defaultContext`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Unexpected tenant-context value of ' + $tmp.tenant-context`" />
+ </return>
+ </outcome>
+ </execute>
+ </outcome>
+ </execute>
+ </outcome>
+ </execute>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.dest-p-interface`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Unable to find p-interface in policy ' + tmp.policy-name`" />
+ </return>
+ </outcome>
+ </switch>
+ <return status='success'></return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-rollback-capacity-db.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-rollback-capacity-db.xml
new file mode 100644
index 00000000..7b1ab18c
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-rollback-capacity-db.xml
@@ -0,0 +1,52 @@
+<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='port-mirror-rollback-capacity-db' mode='sync'>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='select available_capacity
+ from VNICS_CAPACITY
+ where vnics_group_id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.vnics-group-id
+ and vnic_port_name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name'
+ pfx='db.vnics-capacity'>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='tmp.avail-capacity' value='`$db.vnics-capacity.available-capacity + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-capacity`' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="update VNICS_CAPACITY
+ set available_capacity = $tmp.avail-capacity
+ where vnics_group_id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.vnics-group-id
+ and vnic_port_name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name
+" ></update>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </for>
+ <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='delete from VNICS_CONFIGURATION_ID
+ where configuration_id = $tmp.configuration-id
+ and vnics_group_id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.vnics-group-id' ></delete>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='select configuration_id
+ from VNICS_CONFIGURATION_ID
+ where vnics_group_id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.vnics-group-id'
+ pfx='db.vnics-confid'>
+ <outcome value='not-found'>
+ <block>
+ <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='delete from VNICS_CAPACITY
+ where vnics_group_id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.vnics-group-id' ></delete>
+ <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='delete from VNICS_CAPACITY_GROUP
+ where vnics_group_id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.vnics-group-id' ></delete>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-activate-async.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-activate-async.xml
new file mode 100644
index 00000000..0d95f408
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-activate-async.xml
@@ -0,0 +1,765 @@
+<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='port-mirror-topology-operation-activate-async' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.pm-configuration`"/>
+ <parameter name="outputPath" value="tmp.pmc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$tmp.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="pm-mdsal" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed to read port-mirror-configuration from MD-SAL" />
+ </set>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$error-message'`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Cannot find port-mirror-configuration in MD-SAL" />
+ </set>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$error-message'`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='pm.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='pm.configuration-data.' value='`$pm-mdsal.port-mirror-configuration[0].configuration-data.`' />
+ </set>
+ <set>
+ <parameter name='pm.configuration-data.configuration-operation-information.sdnc-request-header.'
+ value='`$port-mirror-topology-operation-input.sdnc-request-header.`' />
+ </set>
+ <set>
+ <parameter name='tmp.configuration-sub-type' value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.probe-type`' />
+ </set>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <block atomic="true">
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' />
+ <parameter name='cto-api.cloud-region-id'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' />
+ <parameter name='cto-api.contrail-route-allotted-resource-id'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.route-allotted-resource-id`' />
+ <parameter name='cto-api.src-contrail-network-fqdn'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-network-fqdn`' />
+ <parameter name='cto-api.collector-contrail-network-fqdn'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-network-fqdn`' />
+ <parameter name='cto-api.owning-entity'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.owning-entity`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-activate' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$error-message'`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block atomic="true">
+ <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv4-address`'>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.analyzer.ip-address'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv4-address`' />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv6-address`'>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.analyzer.ip-address'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv6-address`' />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv4-address`'>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.analyzer.ip-address'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv4-address`' />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv6-address`'>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.analyzer.ip-address'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv6-address`' />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'No dest addresses stored for source port ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" />
+ </set>
+ <block atomic="true">
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block atomic="true">
+ <switch test="`$contrail-set[$src-idx] == 'true'`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='port-mirroring' />
+ <parameter name='api-action' value='disable' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='display-name'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' />
+ <parameter name='default-domain' value='default-domain' />
+ <parameter name='default-project'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' />
+ <parameter name='cloud-region-id'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' />
+ <parameter name='cloud-owner'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' />
+ </execute>
+ </outcome>
+ </switch>
+ <switch test="`$l-interface-set[$src-idx] == 'true'`">
+ <outcome value='true'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id
+ AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner
+ AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id
+ AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id
+ AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="is-port-mirrored" value="false" />
+ </update>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$error-message'`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='port-mirroring' />
+ <parameter name='api-action' value='enable' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='display-name'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' />
+ <parameter name='contrail-virtual-machine-interface-name'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' />
+ <parameter name='contrail-virtual-machine-interface-id'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' />
+ <parameter name='default-domain' value='default-domain' />
+ <parameter name='default-project'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' />
+ <parameter name='traffic-direction' value='both' />
+ <parameter name='analyzer-ip-address'
+ value='`$tmp.analyzer.ip-address`' />
+ <parameter name='udp-port' value='8099' />
+ <parameter name='routing-instance'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-network-fqdn`' />
+ <parameter name='local-preference' value='1' />
+ <parameter name='cloud-region-id'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' />
+ <parameter name='cloud-owner'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' />
+ <outcome value='success'>
+ <set>
+ <parameter name='contrail-set[$src-idx]' value='true' />
+ </set>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed to update policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" />
+ </set>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$error-message'`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ </outcome>
+ <outcome value='pprobe'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='port-mirroring' />
+ <parameter name='api-action' value='enable' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='display-name'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' />
+ <parameter name='contrail-virtual-machine-interface-name'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' />
+ <parameter name='contrail-virtual-machine-interface-id'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' />
+ <parameter name='default-domain' value='default-domain' />
+ <parameter name='default-project'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' />
+ <parameter name='traffic-direction' value='both' />
+ <parameter name='analyzer-ip-address'
+ value='`$tmp.analyzer.ip-address`' />
+ <parameter name='vni' value='1000' />
+ <parameter name='udp-port' value='8099' />
+ <parameter name='routing-instance'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-network-fqdn`' />
+ <parameter name='local-preference' value='1' />
+ <parameter name='juniper-header' value='false' />
+ <parameter name='cloud-region-id'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' />
+ <parameter name='cloud-owner'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' />
+ <outcome value='success'>
+ <set>
+ <parameter name='contrail-set[$src-idx]' value='true' />
+ </set>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed to update policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" />
+ </set>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$error-message'`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id
+ AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner
+ AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id
+ AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id
+ AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="is-port-mirrored" value="true" />
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed to update l-interface object in AAI for interface ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" />
+ </set>
+ <block atomic="true">
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block atomic="true">
+ <switch test="`$contrail-set[$src-idx] == 'true'`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='port-mirroring' />
+ <parameter name='api-action' value='disable' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='display-name'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' />
+ <parameter name='default-domain' value='default-domain' />
+ <parameter name='default-project'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' />
+ <parameter name='cloud-region-id'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' />
+ <parameter name='cloud-owner'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' />
+ </execute>
+ </outcome>
+ </switch>
+ <switch test="`$l-interface-set[$src-idx] == 'true'`">
+ <outcome value='true'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id
+ AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner
+ AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id
+ AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id
+ AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="is-port-mirrored" value="false" />
+ </update>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$error-message'`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed to update l-interface object in AAI for interface ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" />
+ </set>
+ <block atomic="true">
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block atomic="true">
+ <switch test="`$contrail-set[$src-idx] == 'true'`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='port-mirroring' />
+ <parameter name='api-action' value='disable' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='display-name'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' />
+ <parameter name='default-domain' value='default-domain' />
+ <parameter name='default-project'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' />
+ <parameter name='cloud-region-id'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' />
+ <parameter name='cloud-owner'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' />
+ </execute>
+ </outcome>
+ </switch>
+ <switch test="`$l-interface-set[$src-idx] == 'true'`">
+ <outcome value='true'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id
+ AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner
+ AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id
+ AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id
+ AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="is-port-mirrored" value="false" />
+ </update>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$error-message'`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='l-interface-set[$src-idx]' value='true' />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </for>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="configuration"
+ key="configuration.configuration-id = $tmp.configuration-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="operational-status" value="in-service-path" />
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Unable to find configuration object in AAI" />
+ </set>
+ <block atomic="true">
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block atomic="true">
+ <switch test="`$contrail-set[$src-idx] == 'true'`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='port-mirroring' />
+ <parameter name='api-action' value='disable' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='display-name'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' />
+ <parameter name='default-domain' value='default-domain' />
+ <parameter name='default-project'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' />
+ <parameter name='cloud-region-id'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' />
+ <parameter name='cloud-owner'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' />
+ </execute>
+ </outcome>
+ </switch>
+ <switch test="`$l-interface-set[$src-idx] == 'true'`">
+ <outcome value='true'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id
+ AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner
+ AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id
+ AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id
+ AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="is-port-mirrored" value="false" />
+ </update>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$error-message'`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failure updating configuration object in AAI" />
+ </set>
+ <block atomic="true">
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block atomic="true">
+ <switch test="`$contrail-set[$src-idx] == 'true'`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='port-mirroring' />
+ <parameter name='api-action' value='disable' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='display-name'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' />
+ <parameter name='default-domain' value='default-domain' />
+ <parameter name='default-project'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' />
+ <parameter name='cloud-region-id'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' />
+ <parameter name='cloud-owner'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' />
+ </execute>
+ </outcome>
+ </switch>
+ <switch test="`$l-interface-set[$src-idx] == 'true'`">
+ <outcome value='true'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id
+ AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner
+ AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id
+ AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id
+ AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="is-port-mirrored" value="false" />
+ </update>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$error-message'`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='pm.configuration-data.configuration-oper-status.order-status'
+ value='Active' />
+ <parameter name='pm.configuration-data.configuration-oper-status.last-action'
+ value='`$port-mirror-topology-operation-input.request-information.request-action`' />
+ <parameter name='pm.configuration-data.configuration-oper-status.last-rpc-action'
+ value='`$port-mirror-topology-operation-input.sdnc-request-header.svc-action`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.portmirrorconfig.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-pmc" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating md-sal for port-mirror-configuration" />
+ </set>
+ <block atomic="true">
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block atomic="true">
+ <switch test="`$contrail-set[$src-idx] == 'true'`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='port-mirroring' />
+ <parameter name='api-action' value='disable' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='display-name'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' />
+ <parameter name='default-domain' value='default-domain' />
+ <parameter name='default-project'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' />
+ <parameter name='cloud-region-id'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' />
+ <parameter name='cloud-owner'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' />
+ </execute>
+ </outcome>
+ </switch>
+ <switch test="`$l-interface-set[$src-idx] == 'true'`">
+ <outcome value='true'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id
+ AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner
+ AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id
+ AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id
+ AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="is-port-mirrored" value="false" />
+ </update>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$error-message'`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating md-sal for port-mirror-configuration" />
+ </set>
+ <block atomic="true">
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block atomic="true">
+ <switch test="`$contrail-set[$src-idx] == 'true'`">
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='port-mirroring' />
+ <parameter name='api-action' value='disable' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='display-name'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' />
+ <parameter name='default-domain' value='default-domain' />
+ <parameter name='default-project'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' />
+ <parameter name='cloud-region-id'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' />
+ <parameter name='cloud-owner'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' />
+ </execute>
+ </outcome>
+ </switch>
+ <switch test="`$l-interface-set[$src-idx] == 'true'`">
+ <outcome value='true'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id
+ AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner
+ AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id
+ AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id
+ AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="is-port-mirrored" value="false" />
+ </update>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$error-message'`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="200" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='success'>
+ <parameter name='error-code' value='200' />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-activate-sync.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-activate-sync.xml
new file mode 100644
index 00000000..d95950e3
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-activate-sync.xml
@@ -0,0 +1,57 @@
+<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='port-mirror-topology-operation-activate-sync' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.pm.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.pm-configuration`"/>
+ <parameter name="outputPath" value="tmp.pmc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$tmp.pm.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-pmc" />
+ <outcome value='success'>
+ <switch test='`$mdsal-pmc.port-mirror-configuration_length == 1`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.pm.configuration-id`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.pm.configuration-id`" />
+ </return>
+ </outcome>
+ </execute>
+ <switch test="`$mdsal-pmc.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status == 'Created'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Order status is ' + $mdsal-pmc.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status + ' but must be Created'`" />
+ </return>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name='error-code' value='200' />
+ <parameter name='ack-final' value='N' />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-assign-async.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-assign-async.xml
new file mode 100755
index 00000000..edb55570
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-assign-async.xml
@@ -0,0 +1,2253 @@
+<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='port-mirror-topology-operation-assign-async' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' />
+ <parameter name='tmp.src-vnf-id' value='`$port-mirror-topology-operation-input.port-mirror-configuration-request-input.source-port.vnf-information.vnf-id`' />
+ <parameter name='tmp.dest-vnf-id' value='`$port-mirror-topology-operation-input.port-mirror-configuration-request-input.dest-port.vnf-information.vnf-id`' />
+ <parameter name='tmp.dest-pnf-name' value='`$port-mirror-topology-operation-input.port-mirror-configuration-request-input.dest-port.pnf-information.pnf-name`' />
+ <parameter name='tmp.service-instance-id' value='`$port-mirror-topology-operation-input.service-information.service-instance-id`' />
+ <parameter name='tmp.configuration-sub-type' value='`$port-mirror-topology-operation-input.configuration-information.configuration-sub-type`' />
+ </set>
+ <set>
+ <parameter name='pm.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='pm.configuration-data.configuration-operation-information.sdnc-request-header.'
+ value='`$port-mirror-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='pm.configuration-data.configuration-operation-information.request-information.'
+ value='`$port-mirror-topology-operation-input.request-information.`' />
+ <parameter name='pm.configuration-data.configuration-operation-information.service-information.'
+ value='`$port-mirror-topology-operation-input.service-information.`' />
+ <parameter name='pm.configuration-data.configuration-operation-information.configuration-information.'
+ value='`$port-mirror-topology-operation-input.configuration-information.`' />
+ <parameter name='pm.configuration-data.configuration-operation-information.port-mirror-configuration-request-input.'
+ value='`$port-mirror-topology-operation-input.port-mirror-configuration-request-input.`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='select role,nfc_naming_code,pps_capacity,network_role,policy_name
+ from PORT_MIRROR_CAPABILITY cap, PORT_MIRROR_CONFIGURATION conf, SERVICE_PROXY sp
+ where cap.port_mirror_capability_name=conf.port_mirror_capability_name
+ and cap.port_mirror_service_uuid=conf.port_mirror_service_uuid
+ and cap.service_proxy_name=conf.service_proxy_name
+ and cap.service_proxy_name=sp.service_proxy_name
+ and cap.port_mirror_service_uuid=sp.parent_service_uuid
+ and conf.customization_uuid = $port-mirror-topology-operation-input.configuration-information.onap-model-information.model-customization-uuid
+ and conf.port_mirror_service_uuid = $service-data.service-information.onap-model-information.model-uuid
+ order by role'
+ pfx='db.cap[]'>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error reading PORT_MIRROR_CONFIGURATION table" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error reading PORT_MIRROR_CONFIGURATION table" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </get-resource>
+ <for index='cap-idx' start='0' end='`$db.cap_length`' >
+ <switch test='`$db.cap[$cap-idx].role`'>
+ <outcome value='source'>
+ <set>
+ <parameter name='tmp.src-pps' value='`$db.cap[$cap-idx].pps-capacity`' />
+ <parameter name='tmp.src-nfc-naming-code' value='`$db.cap[$cap-idx].nfc-naming-code`' />
+ <parameter name='tmp.src-network-role' value='`$db.cap[$cap-idx].network-role`' />
+ </set>
+ </outcome>
+ <outcome value='collector'>
+ <set>
+ <parameter name='tmp.dest-pps' value='`$db.cap[$cap-idx].pps-capacity`' />
+ <parameter name='tmp.dest-nfc-naming-code' value='`$db.cap[$cap-idx].nfc-naming-code`' />
+ <parameter name='tmp.dest-network-role' value='`$db.cap[$cap-idx].network-role`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="replace">
+ <parameter name="source" value="`$tmp.src-nfc-naming-code`" />
+ <parameter name="target" value=" " />
+ <parameter name="replacement" value="%20" />
+ <parameter name="outputPath" value="tmp.encoded-src-nfc-naming-code" />
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="replace">
+ <parameter name="source" value="`$tmp.dest-nfc-naming-code`" />
+ <parameter name="target" value=" " />
+ <parameter name="replacement" value="%20" />
+ <parameter name="outputPath" value="tmp.encoded-dest-nfc-naming-code" />
+ </execute>
+ <switch test='`$service-data.vnfc-instance-groups.vnfc-instance-group_length`'>
+ <outcome value=''>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <set>
+ <parameter name='tmp.src-vnfc-idx' value='0' />
+ <parameter name='tmp.dest-vnfc-idx' value='1' />
+ </set>
+ </outcome>
+ <outcome value='pprobe'>
+ <set>
+ <parameter name='tmp.src-vnfc-idx' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='vnfc-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group_length`' >
+ <block atomic="true">
+ <switch test="`$service-data.vnfc-instance-groups.vnfc-instance-group[$vnfc-idx].instance-group-role == $tmp.src-network-role`">
+ <outcome value='true'>
+ <switch test='`$service-data.vnfc-instance-groups.vnfc-instance-group[$vnfc-idx].nfc-naming-code == $tmp.src-nfc-naming-code`'>
+ <outcome value='true'>
+ <switch test='`$service-data.vnfc-instance-groups.vnfc-instance-group[$vnfc-idx].configuration-id == $tmp.configuration-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Source nfc-naming-code of ' + $tmp.src-nfc-naming-code + ' already exists in vnfc-instance-groups for this configuration-id'`" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.vnfc-instance-groups.vnfc-instance-group[$vnfc-idx].instance-group-role == $tmp.dest-network-role`">
+ <outcome value='true'>
+ <switch test='`$service-data.vnfc-instance-groups.vnfc-instance-group[$vnfc-idx].nfc-naming-code == $tmp.dest-nfc-naming-code`'>
+ <outcome value='true'>
+ <switch test='`$service-data.vnfc-instance-groups.vnfc-instance-group[$vnfc-idx].configuration-id == $tmp.configuration-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Dest nfc-naming-code of ' + $tmp.dest-nfc-naming-code + ' already exists in vnfc-instance-groups for this configuration-id'`" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <set>
+ <parameter name='tmp.src-vnfc-idx' value='`$service-data.vnfc-instance-groups.vnfc-instance-group_length`' />
+ <parameter name='tmp.dest-vnfc-idx' value='`$service-data.vnfc-instance-groups.vnfc-instance-group_length + 1`' />
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group_length' value='`$service-data.vnfc-instance-groups.vnfc-instance-group_length + 2`'/>
+ </set>
+ </outcome>
+ <outcome value='pprobe'>
+ <set>
+ <parameter name='tmp.src-vnfc-idx' value='`$service-data.vnfc-instance-groups.vnfc-instance-group_length`' />
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group_length' value='`$service-data.vnfc-instance-groups.vnfc-instance-group_length + 1`'/>
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.oe">
+ <parameter name="start[0]" value="`'nodes/service-instances/service-instance?service-instance-id=' + $tmp.service-instance-id `" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="/query/owning-entity-fromService-instance" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query: owning-entity-fromService-instance" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No owning entity returned from AAI: owning-entity-fromService-instance" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.owning-entity' value='`$tmp.AnAI-data.oe.results[0].owning-entity.owning-entity-id`' />
+ </set>
+ </outcome>
+ </save>
+ <switch test='`$tmp.owning-entity`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to retrieve owning-entity from AAI" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.owning-entity' value='`$tmp.owning-entity`' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource&amp;nodesOnly=true'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.vnf">
+ <parameter name="start[0]" value="`'/network/generic-vnfs/generic-vnf/' + $tmp.src-vnf-id `" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="query/cloud-region-fromVnf" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query: cloud-region-fromVnf" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No cloud region returned from AAI: cloud-region-fromVnf" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <for index='result-idx' start='0' end='`$tmp.AnAI-data.vnf.results_length`' >
+ <block atomic="true">
+ <switch test='`$tmp.AnAI-data.vnf.results[$result-idx].tenant.tenant-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.tenant' value='`$tmp.AnAI-data.vnf.results[$result-idx].tenant.tenant-name`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.AnAI-data.vnf.results[$result-idx].tenant.tenant-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.tenant-id' value='`$tmp.AnAI-data.vnf.results[$result-idx].tenant.tenant-id`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.AnAI-data.vnf.results[$result-idx].tenant.tenant-context`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.tenant-context' value='`$tmp.AnAI-data.vnf.results[$result-idx].tenant.tenant-context`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.AnAI-data.vnf.results[$result-idx].cloud-region.cloud-owner`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.cloud-owner' value='`$tmp.AnAI-data.vnf.results[$result-idx].cloud-region.cloud-owner`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.AnAI-data.vnf.results[$result-idx].cloud-region.cloud-region-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.cloud-region-id' value='`$tmp.AnAI-data.vnf.results[$result-idx].cloud-region.cloud-region-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$tmp.tenant`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to retrieve source tenant from AAI" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.tenant-id`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to retrieve source tenant-id from AAI" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.cloud-region-id`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to retrieve tenant from AAI" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.cloud-owner`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to retrieve tenant from AAI" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource&amp;nodesOnly=true'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.dest-vnf">
+ <parameter name="start[0]" value="`'/network/generic-vnfs/generic-vnf/' + $tmp.dest-vnf-id `" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="query/cloud-region-fromVnf" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query: cloud-region-fromVnf, for destination vnf" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No cloud region returned from AAI: cloud-region-fromVnf, for destination vnf" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <for index='result-idx' start='0' end='`$tmp.AnAI-data.dest-vnf.results_length`' >
+ <switch test='`$tmp.AnAI-data.dest-vnf.results[$result-idx].tenant.tenant-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.dest-tenant' value='`$tmp.AnAI-data.dest-vnf.results[$result-idx].tenant.tenant-name`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.AnAI-data.dest-vnf.results[$result-idx].tenant.tenant-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.dest-tenant-id' value='`$tmp.AnAI-data.dest-vnf.results[$result-idx].tenant.tenant-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.dest-tenant`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to retrieve destination tenant from AAI" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.dest-tenant-id`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to retrieve destination tenant-id from AAI" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner'
+ value='`$tmp.cloud-owner`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id'
+ value='`$tmp.cloud-region-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant'
+ value='`$tmp.tenant`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id'
+ value='`$tmp.tenant-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-tenant'
+ value='`$tmp.dest-tenant`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-tenant-id'
+ value='`$tmp.dest-tenant-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-context'
+ value='`$tmp.tenant-context`' />
+ </set>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='pprobe'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-get-policy' mode='sync' >
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.src-network">
+ <parameter name="start[0]" value="`'/cloud-infrastructure/cloud-regions/cloud-region/' + $tmp.cloud-owner + '/' + $tmp.cloud-region-id`" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="`'/query/network-name-fromNetwork-role?networkRole=' + $tmp.src-network-role`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query: network-name-fromNetwork-role" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No network information returned from AAI: network-name-fromNetwork-role" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.dest-network">
+ <parameter name="start[0]" value="`'/cloud-infrastructure/cloud-regions/cloud-region/' + $tmp.cloud-owner + '/' + $tmp.cloud-region-id`" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="`'/query/network-name-fromNetwork-role?networkRole=' + $tmp.dest-network-role`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query: network-name-fromNetwork-role" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No network information returned from AAI: network-name-fromNetwork-role" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.src-li">
+ <parameter value="`'/network/generic-vnfs/generic-vnf/' + $tmp.src-vnf-id`" name="start[0]"/>
+ <parameter value="1" name="start_length"/>
+ <parameter value="`'/query/vserver-fromVnf?nfcNamingCode=' + $tmp.encoded-src-nfc-naming-code`" name="query"/>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query vserver-fromVnf for source vnf" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No interface data returned from AAI vserver-fromVnf for source vnf" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.dest-li">
+ <parameter value="`'/network/generic-vnfs/generic-vnf/' + $tmp.dest-vnf-id`" name="start[0]"/>
+ <parameter value="1" name="start_length"/>
+ <parameter value="`'/query/vserver-fromVnf?nfcNamingCode=' + $tmp.encoded-dest-nfc-naming-code`" name="query"/>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query vserver-fromVnf for dest vnf" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No interface data returned from AAI vserver-fromVnf for dest vnf" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <set>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].instance-group-role'
+ value='`$tmp.src-network-role`'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].nfc-naming-code'
+ value='`$tmp.src-nfc-naming-code`'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].group-type'
+ value='port-mirror-source'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].configuration-id'
+ value='`$tmp.configuration-id`'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].instance-group-role'
+ value='`$tmp.dest-network-role`'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].nfc-naming-code'
+ value='`$tmp.dest-nfc-naming-code`'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].group-type'
+ value='port-mirror-dest'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].configuration-id'
+ value='`$tmp.configuration-id`'/>
+ </set>
+ </outcome>
+ <outcome value='pprobe'>
+ <set>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].instance-group-role'
+ value='`$tmp.src-network-role`'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].nfc-naming-code'
+ value='`$tmp.src-nfc-naming-code`'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].group-type'
+ value='port-mirror-source'/>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].configuration-id'
+ value='`$tmp.configuration-id`'/>
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <set>
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnfc-instance-group-id.nfc-naming-code'
+ value='`$tmp.src-nfc-naming-code`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnfc-instance-group-id.instance-group-role'
+ value='`$tmp.src-network-role`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnfc-instance-group-id.service-instance-id'
+ value='`$tmp.service-instance-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnfc-instance-group-id.configuration-id'
+ value='`$tmp.configuration-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnf-id'
+ value='`$tmp.src-vnf-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-capacity'
+ value='`$tmp.src-pps`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-vnfc-instance-group-id.nfc-naming-code'
+ value='`$tmp.dest-nfc-naming-code`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-vnfc-instance-group-id.instance-group-role'
+ value='`$tmp.dest-network-role`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-vnfc-instance-group-id.service-instance-id'
+ value='`$tmp.service-instance-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-vnfc-instance-group-id.configuration-id'
+ value='`$tmp.configuration-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-vnf-id'
+ value='`$tmp.dest-vnf-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.probe-type'
+ value='vprobe' />
+ </set>
+ </outcome>
+ <outcome value='pprobe'>
+ <set>
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnfc-instance-group-id.nfc-naming-code'
+ value='`$tmp.src-nfc-naming-code`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnfc-instance-group-id.instance-group-role'
+ value='`$tmp.src-network-role`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnfc-instance-group-id.service-instance-id'
+ value='`$tmp.service-instance-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnfc-instance-group-id.configuration-id'
+ value='`$tmp.configuration-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-vnf-id'
+ value='`$tmp.src-vnf-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-capacity'
+ value='`$tmp.src-pps`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-pnf-name'
+ value='`$tmp.dest-pnf-name`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-p-interface'
+ value='`$tmp.dest-p-interface`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-pnf-port-policy-name'
+ value='`$db.cap[0].policy-name`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.probe-type'
+ value='pprobe' />
+ </set>
+ </outcome>
+ </switch>
+ <for index='src-nw-idx' start='0' end='`$tmp.AnAI-data.src-network.results_length`' >
+ <switch test='`$tmp.AnAI-data.src-network.results[$src-nw-idx].l3-network.network-name`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$tmp.src-network-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.src-network-name' value='`$tmp.AnAI-data.src-network.results[$src-nw-idx].l3-network.network-name`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-network-fqdn'
+ value='`$tmp.AnAI-data.src-network.results[$src-nw-idx].l3-network.contrail-network-fqdn`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'More than one l3-network returned from AAI for network-role ' + $tmp.src-network-role`" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.src-network-name`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Cannot determine source network name from AAI data" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <block atomic="true">
+ <for index='dest-nw-idx' start='0' end='`$tmp.AnAI-data.dest-network.results_length`' >
+ <switch test='`$tmp.AnAI-data.dest-network.results[$dest-nw-idx].l3-network.network-name`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$tmp.dest-network-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.dest-network-name' value='`$tmp.AnAI-data.dest-network.results[$dest-nw-idx].l3-network.network-name`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-network-fqdn'
+ value='`$tmp.AnAI-data.dest-network.results[$dest-nw-idx].l3-network.contrail-network-fqdn`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'More than one l3-network returned from AAI for network-role ' + $tmp.dest-network-role`" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.dest-network-name`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Cannot determine dest network name from AAI data" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-create-vnfcs' mode='sync' >
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-mapping-vprobe' mode='sync' >
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='pprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-mapping-pprobe' mode='sync' >
+ <outcome value='failure'>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No usable source l-interfaces found in AAI data" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No usable source l-interfaces found in AAI data" />
+ </set>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <block atomic="true">
+ <set>
+ <parameter name='cto-api.parent-service-instance-id' value='`$tmp.service-instance-id`' />
+ <parameter name='cto-api.port-mirror-configuration-instance-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.source-network-role' value='`$tmp.src-network-role`' />
+ <parameter name='cto-api.collector-network-role' value='`$tmp.dest-network-role`' />
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.cloud-owner' value='`$tmp.cloud-owner`' />
+ <parameter name='cto-api.service-type' value='`$port-mirror-topology-operation-input.service-information.subscription-service-type`' />
+ <parameter name='cto-api.owning-entity' value='`$tmp.owning-entity`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-create' mode='sync' >
+ <outcome value='failure'>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.route-allotted-resource-id'
+ value='`$cto-api.contrail-route-allotted-instance-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.configuration-information.configuration-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.configuration-name' value="`'PMC_' + $tmp.tenant + '_' + $tmp.cloud-region-id + '_' + $port-mirror-topology-operation-input.configuration-information.configuration-type + '_' + $tmp.configuration-id`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.configuration-name' value='`$port-mirror-topology-operation-input.configuration-information.configuration-name`' />
+ </set>
+ </outcome>
+ </switch>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="urlEncode">
+ <parameter name="source" value="`$tmp.link-name`" />
+ <parameter name="outputPath" value="tmp.encoded-link-name" />
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" >
+ <parameter name="link-name" value="`$tmp.link-name`" />
+ <parameter name="in-maint" value="false" />
+ <parameter name="link-type" value="port-mirror-configuration" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed to create logical link ' + $tmp.link-name
+ + ' in AAI'`" />
+ </set>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed to create logical link ' + $tmp.link-name
+ + ' in AAI'`" />
+ </set>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="urlEncode">
+ <parameter name="source" value="`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" />
+ <parameter name="outputPath" value="tmp.encoded-source-port-name" />
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="urlEncode">
+ <parameter name="source" value="`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ <parameter name="outputPath" value="tmp.encoded-dest-port-name" />
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link:relationship-list"
+ key="logical-link.link-name = $tmp.link-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l-interface" />
+ <parameter name="relationship-list.relationship[0].relationship-label" value="org.onap.relationships.inventory.Source" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/cloud-infrastructure/cloud-regions/cloud-region/'
+ + $tmp.cloud-owner + '/' + $tmp.cloud-region-id + '/tenants/tenant/'
+ + $tmp.tenant-id + '/vservers/vserver/'
+ + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id
+ + '/l-interfaces/l-interface/'
+ + $tmp.encoded-source-port-name`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="l-interface" />
+ <parameter name="relationship-list.relationship[1].relationship-label" value="org.onap.relationships.inventory.Destination" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/cloud-infrastructure/cloud-regions/cloud-region/'
+ + $tmp.cloud-owner + '/' + $tmp.cloud-region-id + '/tenants/tenant/'
+ + $tmp.dest-tenant-id + '/vservers/vserver/'
+ + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-vserver-id
+ + '/l-interfaces/l-interface/'
+ + $tmp.encoded-dest-port-name`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed creating relationships for logical link ' + $tmp.link-name
+ + ' in AAI'`" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed creating relationships for logical link ' + $tmp.link-name
+ + ' in AAI'`" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='pprobe'>
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="urlEncode">
+ <parameter name="source" value="`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" />
+ <parameter name="outputPath" value="tmp.encoded-source-port-name" />
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="urlEncode">
+ <parameter name="source" value="`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ <parameter name="outputPath" value="tmp.encoded-dest-port-name" />
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="urlEncode">
+ <parameter name="source" value="`$tmp.dest-p-interface`" />
+ <parameter name="outputPath" value="tmp.encoded-dest-p-interface" />
+ </execute>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link:relationship-list"
+ key="logical-link.link-name = $tmp.link-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l-interface" />
+ <parameter name="relationship-list.relationship[0].relationship-label" value="org.onap.relationships.inventory.Source" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/cloud-infrastructure/cloud-regions/cloud-region/'
+ + $tmp.cloud-owner + '/' + $tmp.cloud-region-id + '/tenants/tenant/'
+ + $tmp.tenant-id + '/vservers/vserver/'
+ + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id
+ + '/l-interfaces/l-interface/'
+ + $tmp.encoded-source-port-name`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="l-interface" />
+ <parameter name="relationship-list.relationship[1].relationship-label" value="org.onap.relationships.inventory.Destination" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/pnfs/pnf/'
+ + $tmp.dest-pnf-name + '/p-interfaces/p-interface/'
+ + $tmp.encoded-dest-p-interface + '/l-interfaces/l-interface/'
+ + $tmp.encoded-dest-port-name`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed creating relationships for logical link ' + $tmp.link-name
+ + ' in AAI'`" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed creating relationships for logical link ' + $tmp.link-name
+ + ' in AAI'`" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="configuration:relationship-list"
+ key="configuration.configuration-id = $tmp.configuration-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="logical-link" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/logical-links/logical-link/' + $tmp.encoded-link-name`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed creating logical-link relationship for configuration ' + $tmp.configuration-id
+ + ' in AAI'`" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed creating logical-link relationship for configuration ' + $tmp.configuration-id
+ + ' in AAI'`" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="configuration"
+ key="configuration.configuration-id = $tmp.configuration-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="configuration-name" value="`$tmp.configuration-name`" />
+ <parameter name="operational-status" value="out-of-service-path" />
+ <parameter name="configuration-selflink" value="`'/config/GENERIC-RESOURCE-API:port-mirror-configurations/port-mirror-configuration/'
+ + $port-mirror-topology-operation-input.configuration-information.configuration-id + '/configuration-data/port-mirror-configuration-topology'`" />
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Unable to find configuration object in AAI" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failure updating configuration object in AAI" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ </update>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="configuration:relationship-list"
+ key="configuration.configuration-id = $tmp.configuration-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="allotted-resource" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/business/customers/customer/' + $service-data.service-information.global-customer-id
+ + '/service-subscriptions/service-subscription/' + $port-mirror-topology-operation-input.service-information.subscription-service-type
+ + '/service-instances/service-instance/' + $tmp.service-instance-id
+ + '/allotted-resources/allotted-resource/' + $cto-api.contrail-route-allotted-instance-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed creating logical-link relationship for configuration ' + $tmp.configuration-id
+ + ' in AAI'`" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ </save>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.configuration-identifiers.configuration-id'
+ value='`$tmp.configuration-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.configuration-identifiers.configuration-type'
+ value='`$port-mirror-topology-operation-input.configuration-information.configuration-type`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.configuration-identifiers.configuration-sub-type'
+ value='`$port-mirror-topology-operation-input.configuration-information.configuration-sub-type`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.configuration-identifiers.parent-service-instance-id'
+ value='`$tmp.service-instance-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.configuration-identifiers.configuration-name'
+ value='`$tmp.configuration-name`' />
+ </set>
+ <switch test='`$service-data.provided-configurations.provided-configuration_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.provided-conf-idx' value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.provided-conf-idx' value='`$service-data.provided-configurations.provided-configuration_length`' />
+ <parameter name='service-data.provided-configurations.provided-configuration_length' value='`$tmp.provided-conf-idx + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.provided-configurations.provided-configuration[$tmp.provided-conf-idx].configuration-id'
+ value='`$tmp.configuration-id`' />
+ <parameter name='service-data.provided-configurations.provided-configuration[$tmp.provided-conf-idx].configuration-type'
+ value='`$port-mirror-topology-operation-input.configuration-information.configuration-type`' />
+ <parameter name='service-data.provided-configurations.provided-configuration[$tmp.provided-conf-idx].configuration-sub-type'
+ value='`$port-mirror-topology-operation-input.configuration-information.configuration-sub-type`' />
+ <parameter name='service-data.provided-configurations.provided-configuration[$tmp.provided-conf-idx].configuration-topology-link'
+ value="`'restconf/config/GENERIC-RESOURCE-API:port-mirror-configurations/port-mirror-configuration/' + $tmp.configuration-id + '/configuration-data/port-mirror-configuration-topology'`" />
+ </set>
+ <set>
+ <parameter name='pm.configuration-data.configuration-oper-status.order-status'
+ value='Created' />
+ <parameter name='pm.configuration-data.configuration-oper-status.last-action'
+ value='`$port-mirror-topology-operation-input.request-information.request-action`' />
+ <parameter name='pm.configuration-data.configuration-oper-status.last-rpc-action'
+ value='`$port-mirror-topology-operation-input.sdnc-request-header.svc-action`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.pm-configuration`"/>
+ <parameter name="outputPath" value="tmp.pmc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$tmp.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.portmirrorconfig.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-pmc" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating md-sal for port-mirror-configuration" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating md-sal for port-mirror-configuration" />
+ </set>
+ <block>
+ <for index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" ></delete>
+ </block>
+ </for>
+ <block>
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project' value='`$tmp.tenant`' />
+ <parameter name='cto-api.cloud-region-id' value='`$tmp.cloud-region-id`' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.rollback-flag' value='true' />
+ <parameter name='tmp.saved-error-message' value='`$error-message`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' ></call>
+ <set>
+ <parameter name='error-message' value='`$tmp.saved-error-message`' />
+ </set>
+ <block>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' ></call>
+ </outcome>
+ </switch>
+ <block>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </block>
+ </block>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="200" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='success'>
+ <parameter name='error-code' value='200' />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-assign-sync.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-assign-sync.xml
new file mode 100755
index 00000000..2cdd98de
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-assign-sync.xml
@@ -0,0 +1,124 @@
+<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='port-mirror-topology-operation-assign-sync' mode='sync'>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='select role,nfc_naming_code,pps_capacity
+ from PORT_MIRROR_CAPABILITY cap, PORT_MIRROR_CONFIGURATION conf, SERVICE_PROXY sp
+ where cap.port_mirror_capability_name=conf.port_mirror_capability_name
+ and cap.port_mirror_service_uuid=conf.port_mirror_service_uuid
+ and cap.service_proxy_name=conf.service_proxy_name
+ and cap.service_proxy_name=sp.service_proxy_name
+ and cap.port_mirror_service_uuid=sp.parent_service_uuid
+ and conf.customization_uuid = $port-mirror-topology-operation-input.configuration-information.onap-model-information.model-customization-uuid
+ and conf.port_mirror_service_uuid = $service-data.service-information.onap-model-information.model-uuid
+ order by role'
+ pfx='db.cap[]'>
+ <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 PORT_MIRROR_CONFIGURATION and PORT_MIRROR_CAPABILITY tables" />
+ </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="`'Unable to find PORT_MIRROR_CONFIGURATION entry for ' + $port-mirror-topology-operation-input.configuration-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test='`$port-mirror-topology-operation-input.configuration-information.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <block atomic="true">
+ <switch test='`$db.cap_length == 2`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'PORT_MIRROR_CONFIGURATION does not contain exactly 2 entries for UUID ' + $port-mirror-topology-operation-input.configuration-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$db.cap[0].role == 'collector'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No collector capability_role found for UUID ' + $port-mirror-topology-operation-input.configuration-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$db.cap[1].role == 'source'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No source capability_role found for UUID ' + $port-mirror-topology-operation-input.configuration-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='pprobe'>
+ <block atomic="true">
+ <switch test='`$db.cap_length == 1`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'PORT_MIRROR_CONFIGURATION does not contain exactly 1 entry for UUID ' + $port-mirror-topology-operation-input.configuration-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$db.cap[0].role == 'source'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No source capability_role found for UUID ' + $port-mirror-topology-operation-input.configuration-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.pm.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.pm-configuration`"/>
+ <parameter name="outputPath" value="tmp.pmc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$tmp.pm.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-pmc" />
+ <outcome value='success'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Port mirror configuration ' + $tmp.pm.configuration-id + ' already exists'`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ </execute>
+ <return status='success'>
+ <parameter name='error-code' value='200' />
+ <parameter name='ack-final' value='N' />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-async.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-async.xml
new file mode 100644
index 00000000..8b07ec16
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-async.xml
@@ -0,0 +1,88 @@
+<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='port-mirror-topology-operation-async' mode='sync'>
+ <block atomic="true">
+ <switch test='`$port-mirror-topology-operation-input.configuration-information.configuration-sub-type`'>
+ <outcome value='pprobe'>
+ <set>
+ <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='pprobe' />
+ </set>
+ </outcome>
+ <outcome value='PPROBE'>
+ <set>
+ <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='pprobe' />
+ </set>
+ </outcome>
+ <outcome value='vprobe'>
+ <set>
+ <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='vprobe' />
+ </set>
+ </outcome>
+ <outcome value='VPROBE'>
+ <set>
+ <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='vprobe' />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <set>
+ <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='vprobe' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-assign-async' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Cannot find assign async DG" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ <outcome value='activate'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-activate-async' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Cannot find activate async DG" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ <outcome value='deactivate'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-deactivate-async' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Cannot find deactivate async DG" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-create-vnfcs.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-create-vnfcs.xml
new file mode 100644
index 00000000..0860c6b6
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-create-vnfcs.xml
@@ -0,0 +1,293 @@
+<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='port-mirror-topology-operation-create-vnfcs' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vnfc-objects-idx' value='0' />
+ </set>
+ <for silentFailure='true' index='src-li-idx' start='0' end='`$tmp.AnAI-data.src-li.results_length`' >
+ <switch test='`$tmp.AnAI-data.src-li.results[$src-li-idx].vnfc.vnfc-name`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnfc-key'
+ value='`$tmp.AnAI-data.src-li.results[$src-li-idx].vnfc.vnfc-name`' />
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnfc-name'
+ value='`$tmp.AnAI-data.src-li.results[$src-li-idx].vnfc.vnfc-name`' />
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnf-id'
+ value='`$tmp.src-vnf-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.vserver-id' value='0' />
+ </set>
+ <for index='rel-idx' start='0' end='`$tmp.AnAI-data.src-li.results[$src-li-idx].vnfc.relationship-list.relationship_length`' >
+ <switch test="`$tmp.AnAI-data.src-li.results[$src-li-idx].vnfc.relationship-list.relationship[$rel-idx].related-to == 'vserver'`">
+ <outcome value='true'>
+ <for index='reldata-idx' start='0' end='`$tmp.AnAI-data.src-li.results[$src-li-idx].vnfc.relationship-list.relationship[$rel-idx].relationship-data_length`' >
+ <switch test="`$tmp.AnAI-data.src-li.results[$src-li-idx].vnfc.relationship-list.relationship[$rel-idx].relationship-data[$reldata-idx].relationship-key == 'vserver.vserver-id'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.vserver-id' value='`$tmp.AnAI-data.src-li.results[$src-li-idx].vnfc.relationship-list.relationship[$rel-idx].relationship-data[$reldata-idx].relationship-value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.vserver-id == 0`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Unable to find vserver related to vnfc ' + $tmp.AnAI-data.src-li.results[$src-li-idx].vnfc.vnfc-name`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <for index='src-vs-idx' start='0' end='`$tmp.AnAI-data.src-li.results_length`' >
+ <switch test='`$tmp.AnAI-data.src-li.results[$src-vs-idx].vserver.vserver-id == $tmp.vserver-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vserver-name'
+ value='`$tmp.AnAI-data.src-li.results[$src-vs-idx].vserver.vserver-name`' />
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vserver-id'
+ value='`$tmp.AnAI-data.src-li.results[$src-vs-idx].vserver.vserver-id`' />
+ <parameter name='tmp.vs-idx' value='`$src-vs-idx`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='tmp.interface-ids_length' value='0' />
+ </set>
+ <for silentFailure='true' index='src-vli-idx' start='0' end='`$tmp.AnAI-data.src-li.results[$tmp.vs-idx].vserver.l-interfaces.l-interface_length`' >
+ <switch test='`$tmp.AnAI-data.src-li.results[$tmp.vs-idx].vserver.l-interfaces.l-interface[$src-vli-idx].network-name == $tmp.src-network-name`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.interface-ids[$tmp.interface-ids_length].interface-id' value='`$tmp.AnAI-data.src-li.results[$tmp.vs-idx].vserver.l-interfaces.l-interface[$src-vli-idx].interface-id`' />
+ <parameter name='tmp.interface-ids_length' value='`$tmp.interface-ids_length + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='tmp.vnic-idx' value='0' />
+ </set>
+ <for silentFailure='true' index='src-rs-idx' start='0' end='`$tmp.AnAI-data.src-li.results_length`' >
+ <switch test='`$tmp.AnAI-data.src-li.results[$src-rs-idx].l-interface.interface-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <for index='in-idx' start='0' end='`$tmp.interface-ids_length`' >
+ <switch test='`$tmp.AnAI-data.src-li.results[$src-rs-idx].l-interface.interface-id == $tmp.interface-ids[$in-idx].interface-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].vnic-port-id'
+ value='`$tmp.AnAI-data.src-li.results[$src-rs-idx].l-interface.interface-id`' />
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].vnic-port-name'
+ value='`$tmp.AnAI-data.src-li.results[$src-rs-idx].l-interface.interface-name`' />
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].capacity.vnic-capacity'
+ value='`$tmp.src-pps`' />
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].capacity.used-capacity'
+ value='0' />
+ </set>
+ <switch test='`$tmp.AnAI-data.src-li.results[$src-rs-idx].l-interface.l3-interface-ipv4-address-list[0].l3-interface-ipv4-address`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].vnic-ip-addresses.ip-addresses.ipv4-address'
+ value='`$tmp.AnAI-data.src-li.results[$src-rs-idx].l-interface.l3-interface-ipv4-address-list[0].l3-interface-ipv4-address`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.AnAI-data.src-li.results[$src-rs-idx].l-interface.l3-interface-ipv6-address-list[0].l3-interface-ipv6-address`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].vnic-ip-addresses.ip-addresses.ipv6-address'
+ value='`$tmp.AnAI-data.src-li.results[$src-rs-idx].l-interface.l3-interface-ipv6-address-list[0].l3-interface-ipv6-address`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vnic-idx' value='`$tmp.vnic-idx + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic_length' value='`$tmp.vnic-idx`' />
+ </set>
+ <set>
+ <parameter name='tmp.vnfc-objects-idx' value='`$tmp.vnfc-objects-idx + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object_length' value='`$tmp.vnfc-objects-idx`' />
+ </set>
+ <set>
+ <parameter name='tmp.vnfc-objects-idx' value='0' />
+ </set>
+ <for silentFailure='true' index='dest-li-idx' start='0' end='`$tmp.AnAI-data.dest-li.results_length`' >
+ <switch test='`$tmp.AnAI-data.dest-li.results[$dest-li-idx].vnfc.vnfc-name`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnfc-key'
+ value='`$tmp.AnAI-data.dest-li.results[$dest-li-idx].vnfc.vnfc-name`' />
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnfc-name'
+ value='`$tmp.AnAI-data.dest-li.results[$dest-li-idx].vnfc.vnfc-name`' />
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnf-id'
+ value='`$tmp.dest-vnf-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.vserver-id' value='0' />
+ </set>
+ <for index='rel-idx' start='0' end='`$tmp.AnAI-data.dest-li.results[$dest-li-idx].vnfc.relationship-list.relationship_length`' >
+ <switch test="`$tmp.AnAI-data.dest-li.results[$dest-li-idx].vnfc.relationship-list.relationship[$rel-idx].related-to == 'vserver'`">
+ <outcome value='true'>
+ <for index='reldata-idx' start='0' end='`$tmp.AnAI-data.dest-li.results[$dest-li-idx].vnfc.relationship-list.relationship[$rel-idx].relationship-data_length`' >
+ <switch test="`$tmp.AnAI-data.dest-li.results[$dest-li-idx].vnfc.relationship-list.relationship[$rel-idx].relationship-data[$reldata-idx].relationship-key == 'vserver.vserver-id'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.vserver-id' value='`$tmp.AnAI-data.dest-li.results[$dest-li-idx].vnfc.relationship-list.relationship[$rel-idx].relationship-data[$reldata-idx].relationship-value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.vserver-id == 0`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Unable to find vserver related to vnfc ' + $tmp.AnAI-data.dest-li.results[$dest-li-idx].vnfc.vnfc-name`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <for index='dest-vs-idx' start='0' end='`$tmp.AnAI-data.dest-li.results_length`' >
+ <switch test='`$tmp.AnAI-data.dest-li.results[$dest-vs-idx].vserver.vserver-id == $tmp.vserver-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vserver-name'
+ value='`$tmp.AnAI-data.dest-li.results[$dest-vs-idx].vserver.vserver-name`' />
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vserver-id'
+ value='`$tmp.AnAI-data.dest-li.results[$dest-vs-idx].vserver.vserver-id`' />
+ <parameter name='tmp.vs-idx' value='`$dest-vs-idx`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='tmp.interface-ids_length' value='0' />
+ </set>
+ <for silentFailure='true' index='dest-vli-idx' start='0' end='`$tmp.AnAI-data.dest-li.results[$tmp.vs-idx].vserver.l-interfaces.l-interface_length`' >
+ <switch test='`$tmp.AnAI-data.dest-li.results[$tmp.vs-idx].vserver.l-interfaces.l-interface[$dest-vli-idx].network-name == $tmp.dest-network-name`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.interface-ids[$tmp.interface-ids_length].interface-id' value='`$tmp.AnAI-data.dest-li.results[$tmp.vs-idx].vserver.l-interfaces.l-interface[$dest-vli-idx].interface-id`' />
+ <parameter name='tmp.interface-ids_length' value='`$tmp.interface-ids_length + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='tmp.vnic-idx' value='0' />
+ </set>
+ <for silentFailure='true' index='dest-rs-idx' start='0' end='`$tmp.AnAI-data.dest-li.results_length`' >
+ <switch test='`$tmp.AnAI-data.dest-li.results[$dest-rs-idx].l-interface.interface-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <for index='in-idx' start='0' end='`$tmp.interface-ids_length`' >
+ <switch test='`$tmp.AnAI-data.dest-li.results[$dest-rs-idx].l-interface.interface-id == $tmp.interface-ids[$in-idx].interface-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].vnic-port-id'
+ value='`$tmp.AnAI-data.dest-li.results[$dest-rs-idx].l-interface.interface-id`' />
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].vnic-port-name'
+ value='`$tmp.AnAI-data.dest-li.results[$dest-rs-idx].l-interface.interface-name`' />
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].capacity.vnic-capacity'
+ value='`$tmp.dest-pps`' />
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].capacity.used-capacity'
+ value='0' />
+ </set>
+ <switch test='`$tmp.AnAI-data.dest-li.results[$dest-rs-idx].l-interface.l3-interface-ipv4-address-list[0].l3-interface-ipv4-address`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].vnic-ip-addresses.ip-addresses.ipv4-address'
+ value='`$tmp.AnAI-data.dest-li.results[$dest-rs-idx].l-interface.l3-interface-ipv4-address-list[0].l3-interface-ipv4-address`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.AnAI-data.dest-li.results[$dest-rs-idx].l-interface.l3-interface-ipv6-address-list[0].l3-interface-ipv6-address`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic[$tmp.vnic-idx].vnic-ip-addresses.ip-addresses.ipv6-address'
+ value='`$tmp.AnAI-data.dest-li.results[$dest-rs-idx].l-interface.l3-interface-ipv6-address-list[0].l3-interface-ipv6-address`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vnic-idx' value='`$tmp.vnic-idx + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.vnfc-objects-idx].vnics.vnic_length' value='`$tmp.vnic-idx`' />
+ </set>
+ <set>
+ <parameter name='tmp.vnfc-objects-idx' value='`$tmp.vnfc-objects-idx + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object_length' value='`$tmp.vnfc-objects-idx`' />
+ </set>
+ <return status='success'></return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-deactivate-async.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-deactivate-async.xml
new file mode 100644
index 00000000..50c52fbf
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-deactivate-async.xml
@@ -0,0 +1,373 @@
+<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='port-mirror-topology-operation-deactivate-async' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.pm-configuration`"/>
+ <parameter name="outputPath" value="tmp.pmc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$tmp.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="pm-mdsal" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed to read port-mirror-configuration from MD-SAL" />
+ </set>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$error-message'`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Cannot find port-mirror-configuration in MD-SAL" />
+ </set>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$error-message'`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='pm.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='pm.configuration-data.' value='`$pm-mdsal.port-mirror-configuration[0].configuration-data.`' />
+ </set>
+ <set>
+ <parameter name='tmp.configuration-sub-type' value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.probe-type`' />
+ </set>
+ <set>
+ <parameter name='pm.configuration-data.configuration-operation-information.sdnc-request-header.'
+ value='`$port-mirror-topology-operation-input.sdnc-request-header.`' />
+ </set>
+ <for silentFailure='true' index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='port-mirroring' />
+ <parameter name='api-action' value='disable' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='display-name'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' />
+ <parameter name='contrail-virtual-machine-interface-name'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' />
+ <parameter name='contrail-virtual-machine-interface-id'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' />
+ <parameter name='policy-name'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' />
+ <parameter name='default-domain' value='default-domain' />
+ <parameter name='default-project'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' />
+ <parameter name='cloud-region-id'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' />
+ <parameter name='cloud-owner'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' />
+ <outcome value='success'>
+ <set>
+ <parameter name='contrail-set[$src-idx]' value='true' />
+ </set>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed to update policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" />
+ </set>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$error-message'`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id
+ AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner
+ AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id
+ AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id
+ AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="is-port-mirrored" value="false" />
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed to update l-interface object in AAI for interface ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" />
+ </set>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$error-message'`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="`'Failed to update l-interface object in AAI for interface ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" />
+ </set>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$error-message'`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='l-interface-set[$src-idx]' value='true' />
+ </set>
+ </outcome>
+ </update>
+ </block>
+ </for>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <block atomic="true">
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' />
+ <parameter name='cto-api.cloud-region-id'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' />
+ <parameter name='cto-api.contrail-route-allotted-resource-id'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.route-allotted-resource-id`' />
+ <parameter name='cto-api.src-contrail-network-fqdn'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-network-fqdn`' />
+ <parameter name='cto-api.collector-contrail-network-fqdn'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-network-fqdn`' />
+ <parameter name='cto-api.rollback-flag' value='false' />
+ <parameter name='cto-api.owning-entity'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.owning-entity`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-deactivate' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$error-message'`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="configuration"
+ key="configuration.configuration-id = $tmp.configuration-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="operational-status" value="out-of-service-path" />
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Unable to find configuration object in AAI" />
+ </set>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$error-message'`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failure updating configuration object in AAI" />
+ </set>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$error-message'`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='pm.configuration-data.configuration-oper-status.order-status'
+ value='Created' />
+ <parameter name='pm.configuration-data.configuration-oper-status.last-action'
+ value='`$port-mirror-topology-operation-input.request-information.request-action`' />
+ <parameter name='pm.configuration-data.configuration-oper-status.last-rpc-action'
+ value='`$port-mirror-topology-operation-input.sdnc-request-header.svc-action`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.portmirrorconfig.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-pmc" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating md-sal for port-mirror-configuration" />
+ </set>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$error-message'`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error updating md-sal for port-mirror-configuration" />
+ </set>
+ <block atomic="true">
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="500" />
+ <parameter name="input.response-message" value="`$error-message`" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$error-message'`" />
+ </return>
+ </block>
+ </block>
+ </outcome>
+ </execute>
+ <configure activate="true" adaptor="com.att.sdnctl.sli.adaptor.mso.MSOAdaptor" key="__READ_FROM_PARAMETERS__">
+ <parameter name="notification-url" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`" />
+ <parameter name="input.ack-final-indicator" value="Y" />
+ <parameter name="input.response-code" value="200" />
+ <parameter name="input.svc-request-id" value="`$port-mirror-topology-operation-input.sdnc-request-header.svc-request-id`" />
+ <parameter name="input.service-information.service-type" value="`$port-mirror-topology-operation-input.service-information.subscription-service-type`" />
+ <parameter name="input.service-information.service-instance-id" value="`$port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ </configure>
+ <return status='success'>
+ <parameter name='error-code' value='200' />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-deactivate-sync.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-deactivate-sync.xml
new file mode 100644
index 00000000..4a1fc278
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-deactivate-sync.xml
@@ -0,0 +1,57 @@
+<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='port-mirror-topology-operation-deactivate-sync' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.pm.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.pm-configuration`"/>
+ <parameter name="outputPath" value="tmp.pmc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$tmp.pm.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-pmc" />
+ <outcome value='success'>
+ <switch test='`$mdsal-pmc.port-mirror-configuration_length == 1`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.pm.configuration-id`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.pm.configuration-id`" />
+ </return>
+ </outcome>
+ </execute>
+ <switch test="`$mdsal-pmc.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status == 'Active'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Order status is ' + $mdsal-pmc.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status + ' but must be Active'`" />
+ </return>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name='error-code' value='200' />
+ <parameter name='ack-final' value='N' />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-disable.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-disable.xml
new file mode 100644
index 00000000..0be852c8
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-disable.xml
@@ -0,0 +1,184 @@
+<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='port-mirror-topology-operation-disable' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.pm-configuration`"/>
+ <parameter name="outputPath" value="tmp.pmc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$tmp.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="pm-mdsal" />
+ <outcome value='success'>
+ <switch test='`$pm-mdsal.port-mirror-configuration_length == 1`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.configuration-id`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.configuration-id`" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='pm.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='pm.configuration-data.' value='`$pm-mdsal.port-mirror-configuration[0].configuration-data.`' />
+ </set>
+ <switch test="`$pm-mdsal.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status == 'Active'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Order status is ' + $mdsal-pmc.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status + ' but must be Active'`" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$idx].source-port-id
+ == $port-mirror-topology-operation-input.port-mirror-configuration-request-input.source-port.source-port-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='src-idx' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$src-idx`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Unable to find source port ' + $port-mirror-topology-operation-input.port-mirror-configuration-request-input.source-port.source-port-id + ' in MD-SAL'`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv4-address`'>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.analyzer.ip-address'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv4-address`' />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv6-address`'>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.analyzer.ip-address'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv6-address`' />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv4-address`'>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.analyzer.ip-address'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv4-address`' />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv6-address`'>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.analyzer.ip-address'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv6-address`' />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'No dest addresses stored for source port ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='port-mirroring' />
+ <parameter name='api-action' value='disable' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='display-name'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' />
+ <parameter name='contrail-virtual-machine-interface-name'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' />
+ <parameter name='contrail-virtual-machine-interface-id'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' />
+ <parameter name='default-domain' value='default-domain' />
+ <parameter name='default-project'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' />
+ <parameter name='traffic-direction' value='both' />
+ <parameter name='analyzer-ip-address'
+ value='`$tmp.analyzer.ip-address`' />
+ <parameter name='udp-port' value='8099' />
+ <parameter name='routing-instance'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-network-fqdn`' />
+ <parameter name='local-preference' value='1' />
+ <parameter name='cloud-region-id'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' />
+ <parameter name='cloud-owner'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' />
+ <outcome value='success'>
+ <set>
+ <parameter name='contrail-set[$src-idx]' value='true' />
+ </set>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" />
+ </return>
+ </outcome>
+ </execute>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id
+ AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner
+ AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id
+ AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id
+ AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="is-port-mirrored" value="false" />
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update l-interface object in AAI for interface ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update l-interface object in AAI for interface ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" />
+ </return>
+ </outcome>
+ </update>
+ <return status='success'>
+ <parameter name='error-code' value='200' />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-enable.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-enable.xml
new file mode 100644
index 00000000..b6d8c6d1
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-enable.xml
@@ -0,0 +1,231 @@
+<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='port-mirror-topology-operation-enable' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.pm-configuration`"/>
+ <parameter name="outputPath" value="tmp.pmc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$tmp.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="pm-mdsal" />
+ <outcome value='success'>
+ <switch test='`$pm-mdsal.port-mirror-configuration_length == 1`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.configuration-id`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.configuration-id`" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='pm.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='pm.configuration-data.' value='`$pm-mdsal.port-mirror-configuration[0].configuration-data.`' />
+ </set>
+ <set>
+ <parameter name='tmp.configuration-sub-type' value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.probe-type`' />
+ </set>
+ <switch test="`$pm-mdsal.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status == 'Active'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Order status is ' + $mdsal-pmc.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status + ' but must be Active'`" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$idx].source-port-id
+ == $port-mirror-topology-operation-input.port-mirror-configuration-request-input.source-port.source-port-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='src-idx' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$src-idx`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Unable to find source port ' + $port-mirror-topology-operation-input.port-mirror-configuration-request-input.source-port.source-port-id + ' in MD-SAL'`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv4-address`'>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.analyzer.ip-address'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv4-address`' />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv6-address`'>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.analyzer.ip-address'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.ipv6-address`' />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv4-address`'>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.analyzer.ip-address'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv4-address`' />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <switch test='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv6-address`'>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.analyzer.ip-address'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-ip-addresses.ip-addresses.vipv6-address`' />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'No dest addresses stored for source port ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='port-mirroring' />
+ <parameter name='api-action' value='enable' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='display-name'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' />
+ <parameter name='contrail-virtual-machine-interface-name'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' />
+ <parameter name='contrail-virtual-machine-interface-id'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' />
+ <parameter name='default-domain' value='default-domain' />
+ <parameter name='default-project'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' />
+ <parameter name='traffic-direction' value='both' />
+ <parameter name='analyzer-ip-address'
+ value='`$tmp.analyzer.ip-address`' />
+ <parameter name='udp-port' value='8099' />
+ <parameter name='routing-instance'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-network-fqdn`' />
+ <parameter name='local-preference' value='1' />
+ <parameter name='cloud-region-id'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' />
+ <parameter name='cloud-owner'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' />
+ <outcome value='success'>
+ <set>
+ <parameter name='contrail-set[$src-idx]' value='true' />
+ </set>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" />
+ </return>
+ </outcome>
+ </execute>
+ </outcome>
+ <outcome value='pprobe'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='port-mirroring' />
+ <parameter name='api-action' value='enable' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='display-name'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' />
+ <parameter name='contrail-virtual-machine-interface-name'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`' />
+ <parameter name='contrail-virtual-machine-interface-id'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-id`' />
+ <parameter name='default-domain' value='default-domain' />
+ <parameter name='default-project'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' />
+ <parameter name='traffic-direction' value='both' />
+ <parameter name='analyzer-ip-address'
+ value='`$tmp.analyzer.ip-address`' />
+ <parameter name='vni' value='1000' />
+ <parameter name='udp-port' value='8099' />
+ <parameter name='routing-instance'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.dest-network-fqdn`' />
+ <parameter name='local-preference' value='1' />
+ <parameter name='juniper-header' value='false' />
+ <parameter name='cloud-region-id'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' />
+ <parameter name='cloud-owner'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner`' />
+ <outcome value='success'>
+ <set>
+ <parameter name='contrail-set[$src-idx]' value='true' />
+ </set>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update policy in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" />
+ </return>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interface"
+ key="cloud-region.cloud-region-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id
+ AND cloud-region.cloud-owner = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-owner
+ AND tenant.tenant-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant-id
+ AND vserver.vserver-id = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-vserver-id
+ AND l-interface.interface-name = $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="is-port-mirrored" value="true" />
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update l-interface object in AAI for interface ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update l-interface object in AAI for interface ' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name`" />
+ </return>
+ </outcome>
+ </update>
+ <return status='success'>
+ <parameter name='error-code' value='200' />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-mapping-pprobe.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-mapping-pprobe.xml
new file mode 100644
index 00000000..aaead563
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-mapping-pprobe.xml
@@ -0,0 +1,108 @@
+<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='port-mirror-topology-operation-mapping-pprobe' mode='sync'>
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l-interfaces"
+ key="pnf.pnf-name = $tmp.dest-pnf-name AND
+ p-interface.interface-name = $tmp.dest-p-interface AND depth='all'"
+ pfx='aai.pnf.p-interface' 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="Destination L-Interfaces are not set for the Destination PNF" />
+ </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 l-interfaces from AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test='`$aai.pnf.p-interface.l-interface_length &gt; 0`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Destination L-Interface is not set for the Destination PNF" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.found-one' value='false' />
+ </set>
+ <for index='idx' start='0' end='`$aai.pnf.p-interface.l-interface_length`' >
+ <switch test='`$aai.pnf.p-interface.l-interface[$idx].l3-interface-ipv4-address-list[0].l3-interface-ipv4-address`'>
+ <outcome value=''>
+ <switch test='`$aai.pnf.p-interface.l-interface[$idx].l3-interface-ipv6-address-list[0].l3-interface-ipv6-address`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.found-one' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.found-one' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.found-one`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Destination Port IP Address is not set for the Destination PNF' />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='map-idx' value='0' />
+ </set>
+ <for silentFailure='true' index='vnfc-so-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object_length`' >
+ <for silentFailure='true' index='vnic-s-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vnics.vnic_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].source-port-id'
+ value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vnics.vnic[$vnic-s-idx].vnic-port-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].source-port-name'
+ value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vnics.vnic[$vnic-s-idx].vnic-port-name`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].source-vserver-id'
+ value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vserver-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-port-id'
+ value='`$aai.pnf.p-interface.l-interface[$idx].interface-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-port-name'
+ value='`$aai.pnf.p-interface.l-interface[$idx].interface-name`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-ip-addresses.ip-addresses.ipv4-address'
+ value='`$aai.pnf.p-interface.l-interface[$idx].l3-interface-ipv4-address-list[0].l3-interface-ipv4-address`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-ip-addresses.ip-addresses.ipv6-address'
+ value='`$aai.pnf.p-interface.l-interface[$idx].l3-interface-ipv6-address-list[0].l3-interface-ipv6-address`' />
+ </set>
+ <set>
+ <parameter name='map-idx' value='`$map-idx + 1`' />
+ </set>
+ </block>
+ </for>
+ </for>
+ <set>
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length'
+ value='`$map-idx`' />
+ </set>
+ <return status='success'></return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-mapping-vprobe.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-mapping-vprobe.xml
new file mode 100644
index 00000000..54218535
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-mapping-vprobe.xml
@@ -0,0 +1,243 @@
+<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='port-mirror-topology-operation-mapping-vprobe' mode='sync'>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='select vnics_group_id
+ from VNICS_CAPACITY_GROUP
+ where service_instance_id = $tmp.service-instance-id
+ and nfc_naming_code = $tmp.dest-nfc-naming-code
+ and vnf_id = $tmp.dest-vnf-id'
+ pfx='db'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failure reading VNICS_CAPACITY_GROUP table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+ key="insert into VNICS_CAPACITY_GROUP
+ (service_instance_id, nfc_naming_code, vnf_id)
+ VALUES ( $tmp.service-instance-id , $tmp.dest-nfc-naming-code , $tmp.dest-vnf-id )"
+ pfx='pfx' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failure to insert record into VNICS_CAPACITY_GROUP table" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='select vnics_group_id
+ from VNICS_CAPACITY_GROUP
+ where service_instance_id = $tmp.service-instance-id
+ and nfc_naming_code = $tmp.dest-nfc-naming-code
+ and vnf_id = $tmp.dest-vnf-id'
+ pfx='db'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failure reading VNICS_CAPACITY_GROUP table" />
+ </return>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </save>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.vnics-group-id'
+ value='`$db.vnics-group-id`' />
+ </set>
+ <for silentFailure='true' index='vnfc-do-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object_length`' >
+ <for silentFailure='true' index='vnic-d-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic_length`' >
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='select available_capacity, vnic_capacity
+ from VNICS_CAPACITY
+ where vnics_group_id = $db.vnics-group-id
+ and vnic_port_name = $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].vnic-port-name'
+ pfx='db.vnics-capacity'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failure reading VNICS_CAPACITY_GROUP table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+ key="insert into VNICS_CAPACITY
+ (vnics_group_id, vnic_port_name, available_capacity, vnic_capacity)
+ VALUES ( $db.vnics-group-id ,
+ $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].vnic-port-name ,
+ $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].capacity.vnic-capacity ,
+ $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].capacity.vnic-capacity
+ )"
+ pfx='pfx' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failure to insert record into VNICS_CAPACITY table" />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].capacity.vnic-capacity'
+ value='`$db.vnics-capacity.available-capacity`' />
+ </set>
+ </outcome>
+ </get-resource>
+ </for>
+ </for>
+ <set>
+ <parameter name='map-idx' value='0' />
+ </set>
+ <for silentFailure='true' index='vnfc-so-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object_length`' >
+ <for silentFailure='true' index='vnic-s-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vnics.vnic_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.found-capacity' value='N' />
+ <parameter name='tmp.save-rem-cap' value='0' />
+ </set>
+ <for silentFailure='true' index='vnfc-do-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object_length`' >
+ <for silentFailure='true' index='vnic-d-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.rem-cap' value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].capacity.vnic-capacity
+ - $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].capacity.used-capacity`' />
+ </set>
+ <switch test='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vnics.vnic[$vnic-s-idx].capacity.vnic-capacity
+ &lt;= $tmp.rem-cap`'>
+ <outcome value='true'>
+ <switch test='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].vnic-ip-addresses.ip-addresses.ipv4-address`'>
+ <outcome value=''>
+ <switch test='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].vnic-ip-addresses.ip-addresses.ipv6-address`'>
+ <outcome value=''>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$tmp.rem-cap &gt; $tmp.save-rem-cap`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.found-capacity' value='Y' />
+ <parameter name='tmp.save-vnfc-do-idx' value='`$vnfc-do-idx`' />
+ <parameter name='tmp.save-vnic-d-idx' value='`$vnic-d-idx`' />
+ <parameter name='tmp.save-rem-cap' value='`$tmp.rem-cap`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$tmp.rem-cap &gt; $tmp.save-rem-cap`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.found-capacity' value='Y' />
+ <parameter name='tmp.save-vnfc-do-idx' value='`$vnfc-do-idx`' />
+ <parameter name='tmp.save-vnic-d-idx' value='`$vnic-d-idx`' />
+ <parameter name='tmp.save-rem-cap' value='`$tmp.rem-cap`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </for>
+ <switch test="`$tmp.found-capacity == 'N'`">
+ <outcome value='true'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'No capacity for source interface '
+ + $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vnics.vnic[$vnic-s-idx].vnic-port-id`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.save-vnfc-do-idx].vnics.vnic[$tmp.save-vnic-d-idx].capacity.used-capacity'
+ value='`$tmp.src-pps + $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.save-vnfc-do-idx].vnics.vnic[$tmp.save-vnic-d-idx].capacity.used-capacity`' />
+ </set>
+ <set>
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].source-port-id'
+ value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vnics.vnic[$vnic-s-idx].vnic-port-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].source-port-name'
+ value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vnics.vnic[$vnic-s-idx].vnic-port-name`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].source-vserver-id'
+ value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.src-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-so-idx].vserver-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-port-id'
+ value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.save-vnfc-do-idx].vnics.vnic[$tmp.save-vnic-d-idx].vnic-port-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-port-name'
+ value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.save-vnfc-do-idx].vnics.vnic[$tmp.save-vnic-d-idx].vnic-port-name`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-vserver-id'
+ value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.save-vnfc-do-idx].vserver-id`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-ip-addresses.ip-addresses.ipv4-address'
+ value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.save-vnfc-do-idx].vnics.vnic[$tmp.save-vnic-d-idx].vnic-ip-addresses.ip-addresses.ipv4-address`' />
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$map-idx].dest-ip-addresses.ip-addresses.ipv6-address'
+ value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$tmp.save-vnfc-do-idx].vnics.vnic[$tmp.save-vnic-d-idx].vnic-ip-addresses.ip-addresses.ipv6-address`' />
+ </set>
+ <set>
+ <parameter name='map-idx' value='`$map-idx + 1`' />
+ </set>
+ </block>
+ </for>
+ </for>
+ <set>
+ <parameter name='pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length'
+ value='`$map-idx`' />
+ </set>
+ <for silentFailure='true' index='vnfc-do-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object_length`' >
+ <for silentFailure='true' index='vnic-d-idx' start='0' end='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic_length`' >
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='select available_capacity
+ from VNICS_CAPACITY
+ where vnics_group_id = $db.vnics-group-id
+ and vnic_port_name = $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].vnic-port-name'
+ pfx='db.vnics-capacity'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failure reading VNICS_CAPACITY table" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.original-avail-capacity' value='`$db.vnics-capacity.available-capacity`' />
+ <parameter name='tmp.original-used-capacity' value='`$service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].capacity.used-capacity`' />
+ <parameter name='tmp.avail-capacity' value='`$db.vnics-capacity.available-capacity - $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].capacity.used-capacity`' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+key="update VNICS_CAPACITY
+ set available_capacity = $tmp.avail-capacity
+ where vnics_group_id = $db.vnics-group-id
+ and vnic_port_name = $service-data.vnfc-instance-groups.vnfc-instance-group[$tmp.dest-vnfc-idx].vnfc-objects.vnfc-object[$vnfc-do-idx].vnics.vnic[$vnic-d-idx].vnic-port-name
+" >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failure updating VNICS_CAPACITY table" />
+ </return>
+ </outcome>
+ </update>
+ </block>
+ </for>
+ </for>
+ <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+ key="insert into VNICS_CONFIGURATION_ID
+ (configuration_id, vnics_group_id)
+ values ( $tmp.configuration-id , $db.vnics-group-id )"
+ pfx='pfx' ></save>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-unassign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-unassign.xml
new file mode 100644
index 00000000..673c5133
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-unassign.xml
@@ -0,0 +1,153 @@
+<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='port-mirror-topology-operation-unassign' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' />
+ <parameter name='tmp.service-instance-id' value='`$port-mirror-topology-operation-input.service-information.service-instance-id`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.pm-configuration`"/>
+ <parameter name="outputPath" value="tmp.pmc-url"/>
+ <parameter name="target" value="{configuration-id}"/>
+ <parameter name="replacement" value="`$tmp.configuration-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="pm-mdsal" />
+ <outcome value='success'>
+ <switch test='`$pm-mdsal.port-mirror-configuration_length == 1`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.configuration-id`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.configuration-id`" />
+ </return>
+ </outcome>
+ </execute>
+ <switch test="`$pm-mdsal.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status == 'Created'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Order status is ' + $mdsal-pmc.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status + ' but must be Created'`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='pm.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='pm.configuration-data.' value='`$pm-mdsal.port-mirror-configuration[0].configuration-data.`' />
+ </set>
+ <set>
+ <parameter name='tmp.configuration-sub-type' value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.probe-type`' />
+ </set>
+ <switch test='`$tmp.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <block atomic="true">
+ <set>
+ <parameter name='cto-api.default-domain' value='default-domain' />
+ <parameter name='cto-api.default-project'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.tenant`' />
+ <parameter name='cto-api.cloud-region-id'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.cloud-region-id`' />
+ <parameter name='cto-api.contrail-route-allotted-resource-id'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.route-allotted-resource-id`' />
+ <parameter name='cto-api.rollback-flag' value='false' />
+ <parameter name='cto-api.configuration-id' value='`$tmp.configuration-id`' />
+ <parameter name='cto-api.owning-entity'
+ value='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.owning-entity`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='api-contrail-route-topology-operation-delete' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-rollback-capacity-db' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='src-idx' start='0' end='`$pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.link-name' value="`'PMC_' + $tmp.configuration-id
+ + '_Source' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].source-port-name
+ + '_Dest' + $pm.configuration-data.port-mirror-configuration-topology.port-mirror-configuration-assignments.source-to-dest-maps.source-to-dest-map[$src-idx].dest-port-name`" />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $tmp.link-name" >
+ <outcome value='failure'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to delete logical-link in AAI: ' + $tmp.link-name`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true"></block>
+ </outcome>
+ </delete>
+ </block>
+ </for>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="configuration"
+ key="configuration.configuration-id = $tmp.configuration-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="operational-status" value="out-of-service-path" />
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Unable to find configuration object in AAI" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failure updating configuration object in AAI" />
+ </return>
+ </outcome>
+ </update>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-pmc" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failed to delete port-mirror-configuration object in MD-SAL" />
+ </return>
+ </outcome>
+ </execute>
+ <return status='success'>
+ <parameter name='error-code' value='200' />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-validation.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-validation.xml
new file mode 100755
index 00000000..5a8dad59
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation-validation.xml
@@ -0,0 +1,237 @@
+<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='port-mirror-topology-operation-validation' mode='sync'>
+ <block atomic="true">
+ <switch test='`$service-data.service-information.subscription-service-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'No service exists for service instance ' + $port-mirror-topology-operation-input.service-information.service-instance-id`" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.configuration-information.configuration-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="No configuration-id supplied in input" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.configuration-information.configuration-sub-type`'>
+ <outcome value='pprobe'>
+ <set>
+ <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='pprobe' />
+ </set>
+ </outcome>
+ <outcome value='PPROBE'>
+ <set>
+ <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='pprobe' />
+ </set>
+ </outcome>
+ <outcome value='vprobe'>
+ <set>
+ <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='vprobe' />
+ </set>
+ </outcome>
+ <outcome value='VPROBE'>
+ <set>
+ <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='vprobe' />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <set>
+ <parameter name='port-mirror-topology-operation-input.configuration-information.configuration-sub-type' value='vprobe' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="configuration-sub-type must be pprobe or vprobe" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block atomic="true">
+ <switch test='`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="svc-notification-url is required for assign" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$port-mirror-topology-operation-input.request-information.request-action == 'CreatePortMirrorConfigurationInstance'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="request-action must be CreatePortMirrorConfigurationInstance for assign" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.configuration-information.configuration-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="configuration-type is required for assign" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.configuration-information.onap-model-information.model-customization-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="configuration-information.onap-model-information.model-customization-uuid is required for assign" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.port-mirror-configuration-request-input.source-port.vnf-information.vnf-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="source vnf-id is required for assign" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.configuration-information.configuration-sub-type`'>
+ <outcome value='vprobe'>
+ <switch test='`$port-mirror-topology-operation-input.port-mirror-configuration-request-input.dest-port.vnf-information.vnf-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="dest vnf-id is required for vprobe assign" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='pprobe'>
+ <switch test='`$port-mirror-topology-operation-input.port-mirror-configuration-request-input.dest-port.pnf-information.pnf-name`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="dest pnf-name is required for pprobe assign" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='activate'>
+ <block atomic="true">
+ <switch test='`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="svc-notification-url is required for activate" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$port-mirror-topology-operation-input.request-information.request-action == 'CreatePortMirrorConfigurationInstance'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="request-action must be CreatePortMirrorConfigurationInstance for activate" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='unassign'>
+ <block atomic="true">
+ <switch test="`$port-mirror-topology-operation-input.request-information.request-action == 'DeletePortMirrorConfigurationInstance'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="request-action must be DeletePortMirrorConfigurationInstance for unassign" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='deactivate'>
+ <block atomic="true">
+ <switch test='`$port-mirror-topology-operation-input.sdnc-request-header.svc-notification-url`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="svc-notification-url is required for deactivate" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$port-mirror-topology-operation-input.request-information.request-action == 'DeletePortMirrorConfigurationInstance'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="request-action must be DeletePortMirrorConfigurationInstance for deactivate" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='enable'>
+ <block atomic="true">
+ <switch test="`$port-mirror-topology-operation-input.request-information.request-action == 'ChangePortMirrorConfigurationInstance'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="request-action must be ChangePortMirrorConfigurationInstance for enable" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.port-mirror-configuration-request-input.source-port.source-port-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="port-mirror-configuration-request-input.source-port.source-port-id is required for enable" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='disable'>
+ <block atomic="true">
+ <switch test="`$port-mirror-topology-operation-input.request-information.request-action == 'ChangePortMirrorConfigurationInstance'`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="request-action must be ChangePortMirrorConfigurationInstance for disable" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$port-mirror-topology-operation-input.port-mirror-configuration-request-input.source-port.source-port-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="port-mirror-configuration-request-input.source-port.source-port-id is required for disable" />
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <return status='success'></return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation.xml
new file mode 100644
index 00000000..fb3cdb2e
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-topology-operation.xml
@@ -0,0 +1,90 @@
+<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='port-mirror-topology-operation' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-validation' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </call>
+ <switch test='`$port-mirror-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-assign-sync' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ <outcome value='activate'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-activate-sync' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ <outcome value='unassign'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-unassign' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ <outcome value='deactivate'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-deactivate-sync' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ <outcome value='enable'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-enable' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ <outcome value='disable'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='port-mirror-topology-operation-disable' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y' />
+ </return>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-object-path' value="`'/config/GENERIC-RESOURCE-API:services/service/'
+ + $port-mirror-topology-operation-input.service-information.service-instance-id + '/service-data/service-topology'`" />
+ <parameter name='port-mirror-object-path' value="`'/config/GENERIC-RESOURCE-API:port-mirror-configurations/port-mirror-configuration/'
+ + $port-mirror-topology-operation-input.configuration-information.configuration-id + '/configuration-data/port-mirror-configuration-topology'`" />
+ </set>
+ <return status='success'></return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_preload-network-topology-operation.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_preload-network-topology-operation.xml
new file mode 100755
index 00000000..2558152b
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_preload-network-topology-operation.xml
@@ -0,0 +1,34 @@
+<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='preload-network-topology-operation' mode='sync'>
+ <block atomic="true">
+ <switch test='`$preload-data.preload-network-topology-information.network-topology-identifier-structure.network-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='preload-data.' value='' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='preload-data.preload-network-topology-information.'
+ value='`$preload-network-topology-operation-input.preload-network-topology-information.`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='preload-data.preload-oper-status.order-status' value='PendingAssignment' />
+ <parameter name='preload-data.preload-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="success" />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_preload-vf-module-topology-operation.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_preload-vf-module-topology-operation.xml
new file mode 100755
index 00000000..91fd4a76
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_preload-vf-module-topology-operation.xml
@@ -0,0 +1,34 @@
+<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='preload-vf-module-topology-operation' mode='sync'>
+ <block atomic="true">
+ <switch test='`$preload-data.preload-vf-module-topology-information.vf-module-topology.vf-module-topology-identifier.vf-module-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='preload-data.' value='' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='preload-data.preload-vf-module-topology-information.'
+ value='`$preload-vf-module-topology-operation-input.preload-vf-module-topology-information.`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='preload-data.preload-oper-status.order-status' value='PendingAssignment' />
+ <parameter name='preload-data.preload-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="success" />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_process-eipam-pools.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_process-eipam-pools.xml
index 9454f4fc..0f27169c 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_process-eipam-pools.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_process-eipam-pools.xml
@@ -9,6 +9,7 @@
<parameter name='eipam-ip-block.entity-id' value='' />
<parameter name='eipam-ip-block.ip-prefix' value='' />
<parameter name='eipam-ip-block.mask' value='' />
+ <parameter name='tmp.location8' value='' />
<parameter name='tmp.l3-network.level1.v4.entity-id' value='' />
<parameter name='tmp.l3-network.level1.v4.ip-prefix' value='' />
<parameter name='tmp.l3-network.level1.v4.mask' value='' />
@@ -30,6 +31,12 @@
<parameter name='tmp.l3-network.level2.v6.pool.pre-existing' value='false' />
<parameter name='tmp.l3-network.level2.v6.subnet.pre-existing' value='false' />
</set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring'>
+ <parameter name="string" value="`$aai.complex.physical-location-id`" />
+ <parameter name="result" value="tmp.location8"/>
+ <parameter name="begin-index" value="0" />
+ <parameter name="end-index" value="8" />
+ </execute>
<set>
<parameter name='tmp.region' value='`$aai.complex.region`' />
<parameter name='tmp.cloud-region-id' value="`$aai.cloud-region.cloud-region-id`" />
@@ -42,20 +49,19 @@
<parameter name='eipam-ip-block.plans_length' value='0' />
<parameter name='eipam-pool.v4.pre-existing' value='false' />
<parameter name='eipam-pool.v6.pre-existing' value='false' />
- <parameter name="tmp.level1-key-value" value="`$aai.complex.physical-location-id + ':' + $aai.cloud-region.cloud-region-id`" />
+ <parameter name="tmp.level1-key-value" value="`$tmp.location8 + ':' + $aai.cloud-region.cloud-region-id`" />
<parameter name="tmp.level2-key-value" value="`$network-model.network-role + ':' + $tmp.l3-network.network-id`" />
<parameter name="tmp.ipv4-cidr-mask" value="`$network-model.ipv4-cidr-mask`" />
<parameter name="tmp.ipv6-cidr-mask" value="`$network-model.ipv6-cidr-mask`" />
</set>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.subnet-size-override-v4" value="`$network-model.ipv4-cidr-mask`" />
+ <parameter name="eipam-ip-block.subnet-size-override-v6" value="`$network-model.ipv6-cidr-mask`" />
+ </set>
<switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`">
<outcome value=''>
- <block>
- <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
- <set>
- <parameter name="eipam-ip-block.subnet-size-override-v4" value="`$network-model.ipv4-cidr-mask`" />
- <parameter name="eipam-ip-block.subnet-size-override-v6" value="`$network-model.ipv6-cidr-mask`" />
- </set>
- </block>
+ <block></block>
</outcome>
<outcome value='Other'>
<block>
@@ -69,12 +75,6 @@
<parameter name='eipam-ip-block.subnet-size-override-v4' value='`$network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx].value`' />
</set>
</outcome>
- <outcome value='Other'>
- <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
- <set>
- <parameter name="eipam-ip-block.subnet-size-override-v4" value="`$network-model.ipv4-cidr-mask`" />
- </set>
- </outcome>
</execute>
<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
<parameter name="source" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx].name`" />
@@ -84,12 +84,6 @@
<parameter name='eipam-ip-block.subnet-size-override-v6' value='`$network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx].value`' />
</set>
</outcome>
- <outcome value='Other'>
- <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
- <set>
- <parameter name="eipam-ip-block.subnet-size-override-v6" value="`$network-model.ipv6-cidr-mask`" />
- </set>
- </outcome>
</execute>
</block>
</for>
@@ -938,4 +932,4 @@
</outcome>
</switch>
</method>
-</service-logic>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_process-generic-eipam-pools.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_process-generic-eipam-pools.xml
new file mode 100755
index 00000000..d713d23e
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_process-generic-eipam-pools.xml
@@ -0,0 +1,661 @@
+<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}'>
+ <!--This DG relys on generate-FQPN to determine the key_names & key_values for all levels for the specified plan-name.-->
+ <method rpc="process-generic-eipam-pools" mode="sync">
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.eipam-error" value="false" />
+ <parameter name="tmp.create-v4-pool-flag" value="N" />
+ <parameter name="tmp.create-v6-pool-flag" value="N" />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ <parameter name="eipam-pool.v4.pre-existing" value="false"/>
+ <parameter name="eipam-pool.v6.pre-existing" value="false"/>
+ <!-- <parameter name="tmp.network-id" value="`$tmp.l3-network.network-id`" /> -->
+ <parameter name="tmp.network-id" value="`$network-topology-operation-input.network-information.network-id`" />
+ </set>
+ <switch test='`$tmp.service-type`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.service-type" value="`$service-data.service-information.subscription-service-type`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.network-instance-group-id`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="tmp.network-instance-group-id" value="`$network-topology-operation-input.network-request-input.network-instance-group-id`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$generate-FQPN-input.network-name`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="generate-FQPN-input.network-name" value="`$network-topology-identifier-structure.network-name`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$generate-FQPN-input.zone`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="generate-FQPN-input.zone" value="`$aai.cloud-region.cloud-zone`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$generate-FQPN-input.network-collection`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name="generate-FQPN-input.network-collection" value="`$aai-network-collection.collection-name`" />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$generate-FQPN-input.aic-cloud-region`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cloud-region"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $aai.cloud-region.cloud-region-id AND
+ depth = '0'"
+ pfx='aai.cloud-region' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'aic-cloud-region, '+ $generate-fqpn-input.aic-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>
+ <switch test='`$aai.cloud-region.relationship-list.relationship_length`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="cloud-region missing relationships in AAI" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="cloud-region missing relationships in AAI" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='ridx' start='0' end='`$aai.cloud-region.relationship-list.relationship_length`' >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='complex.physical-location-id'>
+ <block atomic='true'>
+ <block>
+ <set>
+ <parameter name='tmp.aic-clli' value='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring'>
+ <parameter name='result' value='tmp.truncated.clli8' />
+ <parameter name='string' value='`$tmp.aic-clli`' />
+ <parameter name='begin-index' value='0' />
+ <parameter name='end-index' value='8' />
+ </execute>
+ <set>
+ <parameter name='generate-FQPN-input.location-clli8' value='`$tmp.truncated.clli8`' />
+ </set>
+ </block>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="complex"
+ key="complex.physical-location-id = $aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.complex' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Complex 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 complex from AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='generate-FQPN-input.complex-region' value='`$aai.complex.region`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <set>
+ <parameter name='generate-FQPN-input.aic-cloud-region'
+ value='`$aai.cloud-region.cloud-region-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$generate-FQPN-input.location-clli8`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cloud-region"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $aai.cloud-region.cloud-region-id AND
+ depth = '0'"
+ pfx='aai.cloud-region' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'aic-cloud-region, '+ $generate-fqpn-input.aic-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>
+ <switch test='`$aai.cloud-region.relationship-list.relationship_length`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="cloud-region missing relationships in AAI" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="cloud-region missing relationships in AAI" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='ridx' start='0' end='`$aai.cloud-region.relationship-list.relationship_length`' >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='complex.physical-location-id'>
+ <block atomic='true'>
+ <block>
+ <set>
+ <parameter name='tmp.aic-clli' value='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring'>
+ <parameter name='result' value='tmp.truncated.clli8' />
+ <parameter name='string' value='`$tmp.aic-clli`' />
+ <parameter name='begin-index' value='0' />
+ <parameter name='end-index' value='8' />
+ </execute>
+ <set>
+ <parameter name='generate-FQPN-input.location-clli8' value='`$tmp.truncated.clli8`' />
+ </set>
+ </block>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="complex"
+ key="complex.physical-location-id = $aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.complex' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Complex 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 complex from AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='generate-FQPN-input.complex-region' value='`$aai.complex.region`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <set>
+ <parameter name='generate-FQPN-input.aic-cloud-region'
+ value='`$aai.cloud-region.cloud-region-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$generate-FQPN-input.complex-region`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="cloud-region"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
+ cloud-region.cloud-region-id = $aai.cloud-region.cloud-region-id AND
+ depth = '0'"
+ pfx='aai.cloud-region' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'aic-cloud-region, '+ $generate-fqpn-input.aic-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>
+ <switch test='`$aai.cloud-region.relationship-list.relationship_length`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="cloud-region missing relationships in AAI" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="cloud-region missing relationships in AAI" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='ridx' start='0' end='`$aai.cloud-region.relationship-list.relationship_length`' >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='complex.physical-location-id'>
+ <block atomic='true'>
+ <block>
+ <set>
+ <parameter name='tmp.aic-clli' value='`$aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring'>
+ <parameter name='result' value='tmp.truncated.clli8' />
+ <parameter name='string' value='`$tmp.aic-clli`' />
+ <parameter name='begin-index' value='0' />
+ <parameter name='end-index' value='8' />
+ </execute>
+ <set>
+ <parameter name='generate-FQPN-input.location-clli8' value='`$tmp.truncated.clli8`' />
+ </set>
+ </block>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="complex"
+ key="complex.physical-location-id = $aai.cloud-region.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.complex' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Complex 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 complex from AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='generate-FQPN-input.complex-region' value='`$aai.complex.region`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <set>
+ <parameter name='generate-FQPN-input.aic-cloud-region'
+ value='`$aai.cloud-region.cloud-region-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='N'></outcome>
+ <outcome value='Y'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name' value='`$network-model.eipam-v4-address-plan`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' 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="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="v4FQPN-output." value="generate-FQPN-output."/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='N'></outcome>
+ <outcome value='Y'>
+ <block atomic='true'>
+ <set>
+ <parameter name='generate-FQPN-input.plan-name' value='`$network-model.eipam-v6-address-plan`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-FQPN' 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="`'An error occured while generating FQPN: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="v6FQPN-output." value="generate-FQPN-output."/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ </switch>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <set>
+ <parameter name="eipam-ip-block.subnet-size-override-v4" value="`$network-model.ipv4-cidr-mask`" />
+ <parameter name="eipam-ip-block.subnet-size-override-v6" value="`$network-model.ipv6-cidr-mask`" />
+ </set>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`">
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for index='pidx' start='0' end='`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`' >
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx].name`" />
+ <parameter name="target" value="network_assignments_ipv4_subnet_default_assignment_cidr_mask"/>
+ <outcome value='true'>
+ <set>
+ <parameter name='eipam-ip-block.subnet-size-override-v4' value='`$network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx].value`' />
+ </set>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx].name`" />
+ <parameter name="target" value="network_assignments_ipv6_subnet_default_assignment_cidr_mask"/>
+ <outcome value='true'>
+ <set>
+ <parameter name='eipam-ip-block.subnet-size-override-v6' value='`$network-topology-operation-input.network-request-input.network-input-parameters.param[$pidx].value`' />
+ </set>
+ </outcome>
+ </execute>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <for index="l-idx" start="1" end="`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length + 1`">
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.entity-id' value='' />
+ <parameter name='eipam-ip-block.ip-prefix' value='' />
+ <parameter name='eipam-ip-block.mask' value='' />
+ <parameter name="eipam-ip-block.level" value='`$l-idx`' />
+ <parameter name='eipam-pool.v4.pre-existing' value='false' />
+ <parameter name='eipam-pool.v6.pre-existing' value='false' />
+ </set>
+ <!--tmp.level should be set to 1-->
+ <call module='GENERIC-RESOURCE-API' rpc='eipam-create-generic-pool' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <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.process-generic-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Error creating pool for level"/>
+ <parameter name="field5" value="`$l-idx`"/>
+ </record>
+ <return status="failure">
+ <parameter name="tmp.eipam-error" value="true" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while creating pool" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <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.process-generic-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="`$l-idx`"/>
+ <parameter name="field5" value="`$eipam-pool.v4.pre-existing`"/>
+ <parameter name="field6" value="eipam-pool.v4.pre-existing"/>
+ <parameter name="field7" value="`$eipam-pool.v6.pre-existing`"/>
+ <parameter name="field8" value="tmp.create-v4-pool-flag" />
+ <parameter name="field9" value="`$tmp.create-v4-pool-flag`" />
+ <parameter name="field10" value="tmp.create-v6-pool-flag" />
+ <parameter name="field11" value="`$tmp.create-v6-pool-flag`" />
+ <parameter name="field12" value="Successful" />
+ </record>
+ </block>
+ </outcome>
+ </call>
+ <switch test="`$tmp.allocate-subnet-flag`">
+ <outcome value=""></outcome>
+ <outcome value='N'>
+ <block atomic='true'>
+ <switch test="`$network-model.use-ipv4`">
+ <outcome value='N'></outcome>
+ <outcome value='Y'>
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k WHERE s.plan_name = $network-model.eipam-v4-address-plan and s.entity_id = k.entity_id and k.level = $l-idx and k.key_value = $key-value ; "
+ pfx='tmp.eipam-subnet-row'>
+ <outcome value='success'>
+ <block atomic="true">
+ <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.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Existing eipam-ip-block.ip-prefix for level:" />
+ <parameter name="field5" value="`$l-idx`" />
+ <parameter name="field6" value="Existing eipam-ip-block.mask for level:" />
+ <parameter name="field7" value="`$tmp.eipam-subnet-row.prefix-length`"/>
+ <parameter name="field8" value="ipv4"/>
+ <parameter name="field9" value="`$tmp.eipam-subnet-row.ip-address`"/>
+ </record>
+ <set>
+ <parameter name='tmp.l3-network.level1.v4.subnet.pre-existing' value='true' />
+ <parameter name='tmp.l3-network.level1.v4.entity-id' value='`$tmp.eipam-row.entity-id`' />
+ <parameter name='tmp.l3-network.level1.v4.ip-prefix' value='`$tmp.eipam-row.ip-address`' />
+ <parameter name='tmp.l3-network.level1.v4.mask' value='`$tmp.eipam-row.prefix-length`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.entity-id' value='' />
+ <parameter name='eipam-ip-block.ip-prefix' value='' />
+ <parameter name='eipam-ip-block.mask' value='' />
+ <parameter name="eipam-ip-block.allocate-version" value='ipv4' />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='eipam-allocate-generic-subnet' mode='sync' >
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='eipam-ip-block.v4.allocateSubnetResponse.' value='eipam-ip-block.allocateSubnetResponse.' />
+ </set>
+ <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.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="eipam-ip-block.ip-prefix"/>
+ <parameter name="field5" value="`$eipam-ip-block.ip-prefix`"/>
+ <parameter name="field6" value="eipam-ip-block.mask"/>
+ <parameter name="field7" value="`$eipam-ip-block.v4.allocateSubnetResponse.Mask`"/>
+ <parameter name="field8" value="ipv4"/>
+ <parameter name="field9" value="`$l-idx`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <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.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Failed to allocate ipv4 subnet - failure from eipam-allocate-network-role-subnet"/>
+ <parameter name="field5" value="`$l-idx`" />
+ </record>
+ </block>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ </switch>
+ <switch test="`$network-model.use-ipv6`">
+ <outcome value='N'></outcome>
+ <outcome value='Y'>
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k WHERE s.plan_name = $network-model.eipam-v6-address-plan and s.entity_id = k.entity_id and k.level = $l-idx and k.key_value = $key-value ; "
+ pfx='tmp.eipam-subnet-row'>
+ <outcome value='success'>
+ <block atomic="true">
+ <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.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Existing eipam-ip-block.ip-prefix for level:" />
+ <parameter name="field5" value="`$l-idx`" />
+ <parameter name="field6" value="Existing eipam-ip-block.mask for level:" />
+ <parameter name="field7" value="`$tmp.eipam-subnet-row.prefix-length`"/>
+ <parameter name="field8" value="ipv6"/>
+ <parameter name="field9" value="`$tmp.eipam-subnet-row.ip-address`"/>
+ </record>
+ <set>
+ <parameter name='tmp.l3-network.level1.v6.subnet.pre-existing' value='true' />
+ <parameter name='tmp.l3-network.level1.v6.entity-id' value='`$tmp.eipam-row.entity-id`' />
+ <parameter name='tmp.l3-network.level1.v6.ip-prefix' value='`$tmp.eipam-row.ip-address`' />
+ <parameter name='tmp.l3-network.level1.v6.mask' value='`$tmp.eipam-row.prefix-length`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'>
+ <set>
+ <parameter name='eipam-ip-block.entity-id' value='' />
+ <parameter name='eipam-ip-block.ip-prefix' value='' />
+ <parameter name='eipam-ip-block.mask' value='' />
+ <parameter name="eipam-ip-block.allocate-version" value='ipv6' />
+ <parameter name='eipam-ip-block.plans_length' value='0' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='eipam-allocate-generic-subnet' mode='sync' >
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='eipam-ip-block.v6.allocateSubnetResponse.' value='eipam-ip-block.allocateSubnetResponse.' />
+ </set>
+ <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.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="eipam-ip-block.ip-prefix"/>
+ <parameter name="field5" value="`$eipam-ip-block.ip-prefix`"/>
+ <parameter name="field6" value="eipam-ip-block.mask"/>
+ <parameter name="field7" value="`$eipam-ip-block.v6.allocateSubnetResponse.Mask`"/>
+ <parameter name="field8" value="ipv6"/>
+ <parameter name="field9" value="`$l-idx`" />
+ </record>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <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.process-eipam-pools:REQID"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Failed to allocate ipv6 subnet - failure from eipam-allocate-network-role-subnet"/>
+ <parameter name="field9" value="`$l-idx`" />
+ </record>
+ </block>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value=""></outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Y'></outcome>
+ </switch>
+ </block>
+ </for>
+ <return status='success'>
+ <parameter name="error-code" value="200" />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_query-aai-l3-network-by-network-role.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_query-aai-l3-network-by-network-role.xml
new file mode 100644
index 00000000..64e57652
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_query-aai-l3-network-by-network-role.xml
@@ -0,0 +1,199 @@
+<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='query-aai-l3-network-by-network-role' mode='sync'>
+ <block atomic='true'>
+ <switch test='`$query-aai-l3-network-by-network-role-input.aic-cloud-region`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="query-aai-l3-network-by-network-role-input.aic-cloud-region is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$query-aai-l3-network-by-network-role-input.service-instance-id`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="query-aai-l3-network-by-network-role-input.service-instance-id is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$query-aai-l3-network-by-network-role-input.network-role`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="query-aai-l3-network-by-network-role-input.network-role is null" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='query-aai-l3-network-by-network-role-output.' value='' />
+ </set>
+ <set>
+ <parameter name='tmp.aai.l3-networks.' value='' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-networks"
+ key="l3-network.network-role = $query-aai-l3-network-by-network-role-input.network-role"
+ pfx='tmp.aai.l3-networks' >
+ <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 active l3-network found in AAI with cloud_region_id '
+ + $vnf-topology-operation-input.vnf-request-information.aic-cloud-region + ' and network_role '
+ + $query-aai-l3-network-by-network-role-input.network-role`" />
+ </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 l3-network from AAI with network-role = ' + $query-aai-l3-network-by-network-role-input.network-role`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test='`$tmp.aai.l3-networks.l3-network_length`'>
+ <outcome value='1'>
+ <set>
+ <parameter name='query-aai-l3-network-by-network-role-output.l3-network.'
+ value='`$tmp.aai.l3-networks.l3-network[0].`' />
+ <!--
+<parameter name='query-aai-l3-network-by-network-role-output.network-id'
+ value='`$tmp.aai.l3-networks.l3-network[0].network-id`' /><parameter name='query-aai-l3-network-by-network-role-output.network-name'
+ value='`$tmp.aai.l3-networks.l3-network[0].network-name`' />
+-->
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.l3-network-found' value='0' />
+ </set>
+ <set>
+ <parameter name='cloud.matched.l3-networks_length' value='0' />
+ </set>
+ <for index='network-index' start='0' end='`$tmp.aai.l3-networks.l3-network_length`' >
+ <block>
+ <switch test='`$tmp.aai.l3-networks.l3-network[$network-index].relationship-list.relationship_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name ='tmp.aai.l3-networks.l3-network[$network-index].relationship-list.relationship_length' value = '0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index='ridx' start='0' end='`$tmp.aai.l3-networks.l3-network[$network-index].relationship-list.relationship_length`' >
+ <switch test='`$tmp.aai.l3-networks.l3-network[$network-index].relationship-list.relationship[$ridx].related-to`'>
+ <outcome value='cloud-region'>
+ <for silentFailure='false' index='rdidx' start='0' end="`$tmp.aai.l3-networks.l3-network[$network-index].relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$tmp.aai.l3-networks.l3-network[$network-index].relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='cloud-region.cloud-region-id'>
+ <switch test='`$tmp.aai.l3-networks.l3-network[$network-index].relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value == $query-aai-l3-network-by-network-role-input.aic-cloud-region`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='cloud.matched.l3-networks[$cloud.matched.l3-networks_length].'
+ value='$tmp.aai.l3-networks.l3-network[$network-index].' />
+ </set>
+ <set>
+ <parameter name='cloud.matched.l3-networks_length' value='`$cloud.matched.l3-networks_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <switch test='`$cloud.matched.l3-networks_length`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No l3-network with network-role=' + $query-aai-l3-network-by-network-role-input.network-role + ' and cloud-region=' + $query-aai-l3-network-by-network-role-input.aic-cloud-region + ' found in AAI'`" />
+ </return>
+ </outcome>
+ <outcome value='1'>
+ <set>
+ <parameter name='query-aai-l3-network-by-network-role-output.l3-network.'
+ value='`$cloud.matched.l3-networks[0].`' />
+ <!--
+ <parameter name='query-aai-l3-network-by-network-role-output.network-id'
+ value='`$cloud.matched.l3-networks[0].network-id`' /><parameter name='query-aai-l3-network-by-network-role-output.network-name'
+ value='`$cloud.matched.l3-networks[0].network-name`' />
+-->
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <block>
+ <for index='cidx' start='0' end='`$cloud.matched.l3-networks_length`' >
+ <block>
+ <switch test='`$tmp.aai.l3-networks.l3-network[$network-index].relationship-list.relationship_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name ='tmp.aai.l3-networks.l3-network[$network-index].relationship-list.relationship_length' value = '0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index='ridx' start='0' end='`$cloud.matched.l3-networks[$cidx].relationship-list.relationship_length`' >
+ <switch test='`$cloud.matched.l3-networks[$cidx].relationship-list.relationship[$ridx].related-to`'>
+ <outcome value='service-instance'>
+ <for silentFailure='false' index='rdidx' start='0' end="`$cloud.matched.l3-networks[$cidx].relationship-list.relationship[$ridx].relationship-data_length`" >
+ <switch test='`$cloud.matched.l3-networks[$cidx].relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='service-instance.service-instance-id'>
+ <switch test='`$cloud.matched.l3-networks[$cidx].relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value == $query-aai-l3-network-by-network-role-input.service-instance-id`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='query-aai-l3-network-by-network-role-output.l3-network.'
+ value='`$cloud.matched.l3-networks[$cidx].`' />
+ <!--
+<parameter name='query-aai-l3-network-by-network-role-output.network-id'
+ value='`$cloud.matched.l3-networks[$cidx].network-id`' /><parameter name='query-aai-l3-network-by-network-role-output.network-name'
+ value='`$cloud.matched.l3-networks[$cidx].network-name`' />
+-->
+ </set>
+ <set>
+ <parameter name='tmp.l3-network-found' value='1' />
+ </set>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <return status='success'></return>
+ </block>
+ <switch test='`$tmp.l3-network-found`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No l3-network with network-role=' + $query-aai-l3-network-by-network-role-input.network-role + ' and cloud-region=' + $query-aai-l3-network-by-network-role-input.aic-cloud-region + ' and service-instance-id=' + $query-aai-l3-network-by-network-role-input.service-instance-id + ' found in AAI'`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_rollback-eipam-ip-assignment.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_rollback-eipam-ip-assignment.xml
new file mode 100644
index 00000000..6a4ca1b7
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_rollback-eipam-ip-assignment.xml
@@ -0,0 +1,46 @@
+<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='rollback-eipam-ip-assignment' mode='sync'>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from EIPAM_IP_ASSIGNMENTS
+ WHERE info = $vnf-topology-operation-input.vnf-request-information.vnf-id'>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.status'
+ value="`'PENDING_DELETE_' + $vnf-topology-operation-input.vnf-request-information.vnf-id`" />
+ <parameter name='service-data.service-information.service-type'
+ value='NOT_APPLICABLE' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+ key="UPDATE EIPAM_IP_ASSIGNMENTS set status = $tmp.status
+ WHERE info = $vnf-topology-operation-input.vnf-request-information.vnf-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>
+ </get-resource>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_rollback-generated-names.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_rollback-generated-names.xml
new file mode 100644
index 00000000..d36c4066
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_rollback-generated-names.xml
@@ -0,0 +1,336 @@
+<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='rollback-generated-names' mode='sync'>
+ <block atomic="true">
+ <switch test='`$rollback-generated-names-input.context-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="rollback-generated-names-input.context-id can not be null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$rollback-generated-names-input.naming-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="rollback-generated-names-input.naming-type can not be null" />
+ </return>
+ </outcome>
+ <outcome value='VM_INSTANCE'>
+ <set>
+ <parameter name='rollback-generated-names.index-table-name' value='NAMING_POLICY_VM_NAME_INDEX' />
+ <parameter name='rollback-generated-names.index-table.name-prefix-column' value='vm_name_prefix' />
+ </set>
+ </outcome>
+ <outcome value='VNFC_INSTANCE'>
+ <set>
+ <parameter name='rollback-generated-names.index-table-name' value='NAMING_POLICY_VNFC_NAME_INDEX' />
+ <parameter name='rollback-generated-names.index-table.name-prefix-column' value='vnfc_name_prefix' />
+ </set>
+ </outcome>
+ <outcome value='CLIENT_KEY'>
+ <set>
+ <parameter name='rollback-generated-names.index-table-name' value='EIPAM_CLIENT_KEY_INDEX' />
+ <parameter name='rollback-generated-names.index-table.name-prefix-column' value='vnf_name_prefix' />
+ </set>
+ </outcome>
+ <outcome value='NETWORK_INSTANCE'>
+ <set>
+ <parameter name='rollback-generated-names.index-table-name'
+ value='NETWORK_INSTANCE_NAME_INDEX' />
+ <parameter name='rollback-generated-names.index-table.name-prefix-column'
+ value='network_instance_name_prefix' />
+ </set>
+ </outcome>
+ <outcome value='SERVICE_INSTANCE'>
+ <set>
+ <parameter name='rollback-generated-names.index-table-name'
+ value='SERVICE_INSTANCE_NAME_INDEX' />
+ <parameter name='rollback-generated-names.index-table.name-prefix-column'
+ value='service_instance_name_prefix' />
+ </set>
+ </outcome>
+ <outcome value='VNF_INSTANCE'>
+ <set>
+ <parameter name='rollback-generated-names.index-table-name' value='VNF_NAME_INDEX' />
+ <parameter name='rollback-generated-names.index-table.name-prefix-column'
+ value='vnf_name_prefix' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unknown rollbck-generated-name-input.naming-type: ' + $rollback-generated-names-input.naming-type`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='db.grn.' value='' />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT distinct prefix from GENERIC_RESOURCE_NAME WHERE type = $rollback-generated-names-input.naming-type
+ AND context_id = $rollback-generated-names-input.context-id'
+ pfx='db.grn.distinct-prefix[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="Encountered error reading GENERIC_RESOURCE_NAME table to retrieve distinct prefix"/>
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='db.grn.distinct-prefix_length' value='0' />
+ </set>
+ </outcome>
+ </get-resource>
+ <for index='prefix-index' start='0' end='`$db.grn.distinct-prefix_length`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='db.grn.subset.' value='' />
+ </set>
+ <set>
+ <parameter name='tmp.rb.' value='' />
+ </set>
+ <set>
+ <parameter name='tmp.rb.grn.prefix' value='`$db.grn.distinct-prefix[$prefix-index].prefix`' />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from GENERIC_RESOURCE_NAME WHERE type = $rollback-generated-names-input.naming-type
+ AND context_id = $rollback-generated-names-input.context-id
+ AND prefix = $tmp.rb.grn.prefix order by name_index'
+ pfx='db.grn.subset[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="Encountered error reading GENERIC_RESOURCE_NAME table"/>
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="`'No entry found in GENERIC_RESOURCE_NAME where context_id = ' + $rollback-generated-names-input.context-id + ' and type = ' + $rollback-generated-names-input.naming-type + ' and prefix = ' + $db.grn.distinct-prefix[$prefix-index].prefix`"/>
+ </return>
+ </outcome>
+ </get-resource>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.rb.sql'
+ value="`'SELECT * from ' + $rollback-generated-names.index-table-name
+ + ' WHERE ' + $rollback-generated-names.index-table.name-prefix-column
+ + ' = $tmp.rb.grn.prefix'`" />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.rb.sql`" pfx='db.grn.index-table'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-message' value="`'Error reading the '
+ + $rollback-generated-names.index-table-name
+ + ' table with ' + $rollback-generated-names.name-prefix-column
+ + ' = ' + $tmp.rb.grn.prefix
+ + '. MANUAL clean up is required!'`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-message' value="`'No entries found in '
+ + $rollback-generated-names.index-table-name
+ + ' with '
+ + $rollback-generated-names.name-prefix-column
+ + ' = '
+ + $tmp.rb.grn.prefix `" />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ <set>
+ <parameter name='tmp.rb.grn.max-index'
+ value='`$db.grn.subset[$db.grn.subset_length - 1].name-index`' />
+ </set>
+ <set>
+ <parameter name='tmp.rb.delta-index'
+ value='`$db.grn.index-table.index-number - $tmp.rb.grn.max-index`' />
+ </set>
+ <set>
+ <parameter name='tmp.rb.net-index'
+ value='`$db.grn.index-table.index-number - $db.grn.subset_length`' />
+ </set>
+ <switch test="`$tmp.rb.delta-index == 0`">
+ <outcome value='true'>
+ <switch test="`$tmp.rb.net-index == 0`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.rb.sql'
+ value="`'DELETE from ' + $rollback-generated-names.index-table-name
+ + ' WHERE ' + $rollback-generated-names.index-table.name-prefix-column
+ + ' = $tmp.rb.grn.prefix'`" />
+ <!--
++ ' = $tmp.rb.grn.prefix AND index_number = $db.grn.index-table.index-number'`" />
+-->
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.rb.sql`">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-message' value="`'Error deleting '
+ + $rollback-generated-names.index-table-name
+ + ' WHERE ' + $rollback-generated-names.name-prefix-column
+ + ' = ' + $tmp.rb.grn.prefix
+ + ' AND index_number = ' + $db.index-table.index-number
+ + '. MANUAL clean up is required!'`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.rb.sql'
+ value="`'UPDATE ' + $rollback-generated-names.index-table-name
+ + ' set index_number = ' + $tmp.rb.net-index
+ + ' WHERE ' + $rollback-generated-names.index-table.name-prefix-column
+ + ' = $tmp.rb.grn.prefix'`" />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.rb.sql`">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-message' value="`'Error updating '
+ + $rollback-generated-names.index-table-name + '.index_number = '
+ + $tmp.rb.net-index
+ + ' WHERE ' + $rollback-generated-names.name-prefix-column
+ + ' = ' + $tmp.rb.grn.prefix
+ + '. MANUAL clean up is required!'`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-message' value="`'Error updating '
+ + $rollback-generated-names.index-table-name + '.index_number = '
+ + $tmp.rb.net-index
+ + ' WHERE ' + $rollback-generated-names.name-prefix-column
+ + ' = ' + $tmp.rb.grn.prefix
+ + '. MANUAL clean up is required!'`" />
+ </return>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='false'>
+ <block></block>
+ </outcome>
+ </switch>
+ <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='DELETE from GENERIC_RESOURCE_NAME WHERE type = $rollback-generated-names-input.naming-type
+ AND context_id = $rollback-generated-names-input.context-id
+ AND prefix = $tmp.rb.grn.prefix'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-message' value="`'Error deleting GENERIC_RESOURCE_NAME WHERE type = '
+ + $rollback-generated-names-input.naming-type
+ + ' AND context_id = ' + $rollback-generated-names-input.context-id
+ + ' AND prefix = '+ $tmp.rb.grn.prefix
+ + '. MANUAL clean up is required!'`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </delete>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from GENERIC_RESOURCE_NAME WHERE type = $rollback-generated-names-input.naming-type
+ AND prefix = $tmp.rb.grn.prefix order by name_index'
+ pfx='db.grn.prefix[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500'/>
+ <parameter name='error-message' value="Encountered error reading GENERIC_RESOURCE_NAME table"/>
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='tmp.rb.sql'
+ value="`'DELETE from ' + $rollback-generated-names.index-table-name
+ + ' WHERE ' + $rollback-generated-names.index-table.name-prefix-column
+ + ' = $tmp.rb.grn.prefix'`" />
+ <!--
++ ' = $tmp.rb.grn.prefix AND index_number = $db.grn.index-table.index-number'`" />
+-->
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.rb.sql`">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-message' value="`'Error deleting '
+ + $rollback-generated-names.index-table-name
+ + ' WHERE ' + $rollback-generated-names.name-prefix-column
+ + ' = ' + $tmp.rb.grn.prefix
+ + ' AND index_number = ' + $db.index-table.index-number`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='tmp.rb.grn.last-max-index'
+ value='`$db.grn.prefix[$db.grn.prefix_length - 1].name-index`' />
+ </set>
+ <switch test="`$tmp.rb.net-index > $tmp.rb.grn.last-max-index`">
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.rb.sql'
+ value="`'UPDATE ' + $rollback-generated-names.index-table-name
+ + ' set index_number = ' + $tmp.rb.grn.last-max-index
+ + ' WHERE ' + $rollback-generated-names.index-table.name-prefix-column
+ + ' = $tmp.rb.grn.prefix'`" />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="`$tmp.rb.sql`">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-message' value="`'Error updating '
+ + $rollback-generated-names.index-table-name + '.index_number = '
+ + $tmp.rb.grn.last-max-index
+ + ' WHERE ' + $rollback-generated-names.name-prefix-column
+ + ' = ' + $tmp.rb.grn.prefix`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-message' value="`'Error updating '
+ + $rollback-generated-names.index-table-name + '.index_number = '
+ + $tmp.rb.grn.last-max-index
+ + ' WHERE ' + $rollback-generated-names.name-prefix-column
+ + ' = ' + $tmp.rb.grn.prefix`" />
+ </return>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </for>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-activate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-activate.xml
index 82f6efaf..f49173a6 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-activate.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-activate.xml
@@ -1,118 +1,150 @@
-<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='security-zone-topology-operation-activate' mode='sync'>
-<block atomic="true"><set>
-<parameter name='tmp.ar.allotted-resource-id' value='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
-<parameter name='tmp.ar.parent-service-instance-id' value='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
-<parameter name='tmp.ar.sz-vnf-id' value='`$security-zone-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' />
-
-
-</set><set>
-<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:security-zone-allotted-resources/security-zone-allotted-resource/'
- + $tmp.ar.allotted-resource-id
- + '/allotted-resource-data/security-zone-topology/'` " />
-
-</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
- <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
- <parameter name='contextPrefix' value='prop' />
-</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/>
- <parameter name="outputPath" value="tmp.ar-url"/>
- <parameter name="target" value="{allotted-resource-id}"/>
- <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
-</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='GET' />
- <parameter name="responsePrefix" value="mdsal-ar" />
-
-<outcome value='success'>
-<block atomic="true">
-<set>
-<parameter name='bk-sz-ar' value='$mdsal-ar.' />
-</set><switch test='`$mdsal-ar.security-zone-allotted-resource_length`'>
-<outcome value='1'>
-<block atomic='true'>
-<set>
-<parameter name='sz-ar.' value='$mdsal-ar.security-zone-allotted-resource[0].' />
-</set><switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
-<outcome value='Created'>
-<block>
-</block></outcome><outcome value='Other'>
-<block>
-</block></outcome></switch><set>
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
-
-</set></block></outcome></switch></block></outcome><outcome value='Other'>
-<block atomic="true">
-</block></outcome></execute><set>
-<parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
-<parameter name='sz-ar.allotted-resource-status.action' value="`$security-zone-topology-operation-input.request-information.request-action` " />
-<parameter name='sz-ar.allotted-resource-status.rpc-name' value="security-zone-topology-operation" />
-<parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$security-zone-topology-operation-input.sdnc-request-header.svc-action` " />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$security-zone-topology-operation-input.request-information.` " />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$security-zone-topology-operation-input.sdnc-request-header.` " />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$security-zone-topology-operation-input.service-information.` " />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$security-zone-topology-operation-input.allotted-resource-information.` " />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.security-zone-request-input.' value="`$security-zone-topology-operation-input.security-zone-request-input.` " /></set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
- <parameter name="outputPath" value="tmp.current-time" />
-
-</execute><set>
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Active' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$security-zone-topology-operation-input.request-information.request-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-request-id`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
-</set><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="allotted-resource"
- key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
- service-subscription.service-type = $service-data.service-information.subscription-service-type AND
- service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
- allotted-resource.id = $tmp.ar.allotted-resource-id"
- pfx='pfx' local-only='false' force='false'>
- <parameter name="operational-status" value="in-service-path" />
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="AAI failed" />
-</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="AAI failed" />
-</return></outcome></update><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='PUT' />
- <parameter name="responsePrefix" value="mdsal-ar" />
-
-<outcome value='success'>
-<block>
-</block></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 updating md-sal for security-zone-allotted-resource" />
-</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="Error updating md-sal for security-zone-allotted-resource" />
-</return></outcome></execute><set>
-<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
-<parameter name='security-zone-object-path' value="`$tmp.ar.self-link`"/>
-<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
- + $security-zone-topology-operation-input.service-information.service-instance-id
- + '/service-data/service-topology/'`"/>
-
-</set><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>
+<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='security-zone-topology-operation-activate' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ar.allotted-resource-id' value='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+ <parameter name='tmp.ar.parent-service-instance-id' value='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+ <parameter name='tmp.ar.sz-vnf-id' value='`$security-zone-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:security-zone-allotted-resources/security-zone-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/security-zone-topology/'` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='bk-sz-ar' value='$mdsal-ar.' />
+ </set>
+ <switch test='`$mdsal-ar.security-zone-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name='sz-ar.' value='$mdsal-ar.security-zone-allotted-resource[0].' />
+ </set>
+ <switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+ <outcome value='Created'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <parameter name='sz-ar.allotted-resource-status.action' value="`$security-zone-topology-operation-input.request-information.request-action` " />
+ <parameter name='sz-ar.allotted-resource-status.rpc-name' value="security-zone-topology-operation" />
+ <parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$security-zone-topology-operation-input.sdnc-request-header.svc-action` " />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$security-zone-topology-operation-input.request-information.` " />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$security-zone-topology-operation-input.sdnc-request-header.` " />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$security-zone-topology-operation-input.service-information.` " />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$security-zone-topology-operation-input.allotted-resource-information.` " />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.security-zone-request-input.' value="`$security-zone-topology-operation-input.security-zone-request-input.` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Active' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$security-zone-topology-operation-input.request-information.request-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-request-id`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="operational-status" value="in-service-path" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </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="AAI failed" />
+ </return>
+ </outcome>
+ </update>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block></block>
+ </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 updating md-sal for security-zone-allotted-resource" />
+ </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="Error updating md-sal for security-zone-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+ <parameter name='security-zone-object-path' value="`$tmp.ar.self-link`"/>
+ <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $security-zone-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-assign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-assign.xml
index b6a2fd56..cb8450bf 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-assign.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-assign.xml
@@ -1,280 +1,348 @@
-<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='security-zone-topology-operation-assign' mode='sync'>
-<block atomic="true"><set>
-<parameter name='tmp.ar.allotted-resource-id' value='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
-<parameter name='tmp.ar.parent-service-instance-id' value='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
-<parameter name='tmp.ar.sz-vnf-id' value='`$security-zone-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' />
-
-
-</set><set>
-<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:security-zone-allotted-resources/security-zone-allotted-resource/'
- + $tmp.ar.allotted-resource-id
- + '/allotted-resource-data/security-zone-topology/'` " />
-
-</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
- <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
- <parameter name='contextPrefix' value='prop' />
-</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/>
- <parameter name="outputPath" value="tmp.ar-url"/>
- <parameter name="target" value="{allotted-resource-id}"/>
- <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
-</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$prop.restapi.vnf-provided-allottedresource`" />
- <parameter name="outputPath" value="tmp.vnf-p-ar-url" />
- <parameter name="target" value="{service-instance-id}" />
- <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`" />
-</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.vnf-p-ar-url`" />
- <parameter name="outputPath" value="tmp.vnf-p-ar-url" />
- <parameter name="target" value="{vnf-id}"/>
- <parameter name="replacement" value="`$tmp.ar.sz-vnf-id`"/>
-</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='GET' />
- <parameter name="responsePrefix" value="mdsal-ar" />
-
-<outcome value='success'>
-<block atomic="true">
-<set>
-<parameter name='bk-sz-ar' value='$mdsal-ar.' />
-</set><switch test='`$mdsal-ar.security-zone-allotted-resource_length`'>
-<outcome value='1'>
-<block atomic='true'>
-<set>
-<parameter name='sz-ar.' value='$mdsal-ar.security-zone-allotted-resource[0].' />
-</set><switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
-<outcome value='Created'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message"
- value="`'Existing security-zone-allotted-resource with order status of ' + $sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`" />
-</return></outcome><outcome value='PendingDelete'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message"
- value="`'Existing security-zone-allotted-resource with order status of ' + $sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`" />
-</return></outcome></switch><set>
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
-
-</set></block></outcome></switch></block></outcome><outcome value='Other'>
-<block atomic="true">
-</block></outcome></execute><set>
-<parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
-<parameter name='sz-ar.allotted-resource-status.action' value="`$security-zone-topology-operation-input.request-information.request-action` " />
-<parameter name='sz-ar.allotted-resource-status.rpc-name' value="security-zone-topology-operation" />
-<parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$security-zone-topology-operation-input.sdnc-request-header.svc-action` " />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$security-zone-topology-operation-input.request-information.` " />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$security-zone-topology-operation-input.sdnc-request-header.` " />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$security-zone-topology-operation-input.service-information.` " />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$security-zone-topology-operation-input.allotted-resource-information.` " />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.security-zone-request-input.' value="`$security-zone-topology-operation-input.security-zone-request-input.` " /></set><set>
-<parameter name='sz-ar-identifiers.consuming-service-instance-id' value="`$security-zone-topology-operation-input.service-information.service-instance-id` " />
-<parameter name='sz-ar-identifiers.parent-service-instance-id' value="`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id` " />
-<parameter name='sz-ar-identifiers.allotted-resource-type' value="`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-type` " />
-<parameter name='sz-ar-identifiers.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
-
-</set><set>
-<parameter name='sz-ar.allotted-resource-data.security-zone-topology.onap-model-information.'
-value="`$security-zone-topology-operation-input.allotted-resource-information.onap-model-information.`" />
-
-
-</set><switch test='$security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-invariant-uuid'>
-<outcome value=''>
-<set>
-<parameter name='sz-ar.allotted-resource-data.security-zone-topology.onap-model-information.model-invariant-uuid'
-value="`$ar-model.invariant-uuid`" />
-
-
-</set></outcome></switch><switch test='$security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-uuid'>
-<outcome value=''>
-<set>
-<parameter name='sz-ar.allotted-resource-data.security-zone-topology.onap-model-information.model-uuid'
-value="`$ar-model.uuid`" />
-
-
-</set></outcome></switch><switch test='$security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-version'>
-<outcome value=''>
-<set>
-<parameter name='sz-ar.allotted-resource-data.security-zone-topology.onap-model-information.model-version'
-value="`$ar-model.version`" />
-
-
-</set></outcome></switch><switch test='`$ar-model.ecomp-generated-naming`'>
-<outcome value='Y'>
-<block atomic="true">
-<switch test='`$ar-model.naming-policy`'>
-<outcome value='oam_security_zone_name'>
-<block atomic='true'>
-<set>
-<parameter name='tmp.ar-name' value='$TenantOAMNetworkRole_$LandingNetworkRole_SZ' />
-</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.ar-name`"/>
- <parameter name="outputPath" value="tmp.ar-name"/>
- <parameter name="target" value="$TenantOAMNetworkRole"/>
- <parameter name="replacement" value="`$security-zone-topology-operation-input.security-zone-request-input.untrusted-network-role`"/>
-
-</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.ar-name`"/>
- <parameter name="outputPath" value="tmp.ar-name"/>
- <parameter name="target" value="$LandingNetworkRole"/>
- <parameter name="replacement" value="`$security-zone-topology-operation-input.security-zone-request-input.trusted-network-role`"/>
-
-</execute><set>
-<parameter name='sz-ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
-</set></block></outcome><outcome value='Other'>
-<block atomic='true'>
-<set>
-<parameter name='tmp.ar-name' value='$TenantOAMNetworkRole_$LandingNetworkRole_SZ' />
-</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.ar-name`"/>
- <parameter name="outputPath" value="tmp.ar-name"/>
- <parameter name="target" value="$TenantOAMNetworkRole"/>
- <parameter name="replacement" value="`$security-zone-topology-operation-input.security-zone-request-input.untrusted-network-role`"/>
-
-</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.ar-name`"/>
- <parameter name="outputPath" value="tmp.ar-name"/>
- <parameter name="target" value="$LandingNetworkRole"/>
- <parameter name="replacement" value="`$security-zone-topology-operation-input.security-zone-request-input.trusted-network-role`"/>
-
-</execute><set>
-<parameter name='sz-ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
-</set></block></outcome></switch></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="Error in allotted-resource-model data. Ecomp-generated-naming should be true" />
-
-</return></outcome></switch><set>
-<parameter name='sz-ar.allotted-resource-data.security-zone-topology.allotted-resource-identifiers.'
-value="`$sz-ar-identifiers.`" />
-
-
-</set><set>
-<parameter name='sz-ar-assignments.vlan-tag' value="`$security-zone-topology-operation-input.security-zone-request-input.vlan-tag` " />
-<parameter name='sz-ar-assignments.trusted-network-role' value="`$security-zone-topology-operation-input.security-zone-request-input.trusted-network-role` " />
-<parameter name='sz-ar-assignments.untrusted-network-role' value="`$security-zone-topology-operation-input.security-zone-request-input.untrusted-network-role` " />
-<parameter name='sz-ar-assignments.security-zone-service-instance-id' value="`$tmp.ar.parent-service-instance-id` " />
-
-</set><call module='GENERIC-RESOURCE-API' rpc='generate-panorama-name' mode='sync' >
-</call><set>
-<parameter name='sz-ar-assignments.security-zone-name-untrusted' value="`$tmp.untrust-sz` " />
-<parameter name='sz-ar-assignments.security-zone-name-trusted' value="`$tmp.trust-sz` " />
-
-
-</set><set>
-<parameter name='sz-ar.allotted-resource-data.security-zone-topology.security-zone-assignments.'
-value="`$sz-ar-assignments.`" />
-
-
-</set><switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'>
-<outcome value=''>
-<set>
-<parameter name='tmp.cidx' value="`0`" />
-<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value="1" />
-
-
-</set></outcome><outcome value='Other'>
-<block atomic="true"><for index='cidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' >
-<switch test="`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].allotted-resource-id == $tmp.ar.allotted-resource-id`">
-
-<outcome value='true'>
-<block atomic="true"><set>
-<parameter name='tmp.cidx' value='`$cidx`' />
-<parameter name='ctx.consumed-ar.' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].`' />
-<parameter name='tmp.found-cidx' value='true' /></set><break/></block></outcome></switch></for><switch test='`$tmp.found-cidx`'>
-<outcome value='false'>
-<block atomic="true"><set>
-<parameter name='tmp.cidx' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' />
-</set></block></outcome></switch></block></outcome></switch><set>
-<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
-<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-type' value="`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-type` " />
-<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-pointer' value="`$tmp.ar.self-link` " />
-<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value='`$tmp.cidx + 1`' />
-
-</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
- <parameter name="outputPath" value="tmp.current-time" />
-
-</execute><set>
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingCreate' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$security-zone-topology-operation-input.request-information.request-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-request-id`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
-</set><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="allotted-resource"
- key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
- service-subscription.service-type = $service-data.service-information.subscription-service-type AND
- service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
- allotted-resource.id = $tmp.ar.allotted-resource-id"
- pfx='pfx' local-only='false' force='false'>
- <parameter name="description" value="`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-type`" />
- <parameter name="selflink" value="`$tmp.ar.self-link`" />
- <parameter name="model-invariant-id" value="`$ar-model.invariant-uuid`" />
- <parameter name="model-version-id" value="`$ar-model.uuid`" />
- <parameter name="operational-status" value="null" />
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="AAI failed" />
-</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="AAI failed" />
-</return></outcome></update><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='PUT' />
- <parameter name="responsePrefix" value="mdsal-ar" />
-
-<outcome value='success'>
-<block>
-<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='DELETE' />
- <parameter name="responsePrefix" value="parent" />
-
-<outcome value='success'>
-<block>
-</block></outcome><outcome value='failure'>
-<block>
-</block></outcome><outcome value='not-found'>
-<block>
-</block></outcome></execute></block></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 updating md-sal for security-zone-allotted-resource" />
-</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="Error updating md-sal for security-zone-allotted-resource" />
-</return></outcome></execute><set>
-<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
-<parameter name='security-zone-object-path' value="`$tmp.ar.self-link`"/>
-<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
- + $security-zone-topology-operation-input.service-information.service-instance-id
- + '/service-data/service-topology/'`"/>
-
-</set><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>
+<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='security-zone-topology-operation-assign' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ar.allotted-resource-id' value='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+ <parameter name='tmp.ar.parent-service-instance-id' value='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+ <parameter name='tmp.ar.sz-vnf-id' value='`$security-zone-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:security-zone-allotted-resources/security-zone-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/security-zone-topology/'` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vnf-provided-allottedresource`" />
+ <parameter name="outputPath" value="tmp.vnf-p-ar-url" />
+ <parameter name="target" value="{service-instance-id}" />
+ <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`" />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.vnf-p-ar-url`" />
+ <parameter name="outputPath" value="tmp.vnf-p-ar-url" />
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.sz-vnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='bk-sz-ar' value='$mdsal-ar.' />
+ </set>
+ <switch test='`$mdsal-ar.security-zone-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name='sz-ar.' value='$mdsal-ar.security-zone-allotted-resource[0].' />
+ </set>
+ <switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+ <outcome value='Created'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Existing security-zone-allotted-resource with order status of ' + $sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`" />
+ </return>
+ </outcome>
+ <outcome value='PendingDelete'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Existing security-zone-allotted-resource with order status of ' + $sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <parameter name='sz-ar.allotted-resource-status.action' value="`$security-zone-topology-operation-input.request-information.request-action` " />
+ <parameter name='sz-ar.allotted-resource-status.rpc-name' value="security-zone-topology-operation" />
+ <parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$security-zone-topology-operation-input.sdnc-request-header.svc-action` " />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$security-zone-topology-operation-input.request-information.` " />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$security-zone-topology-operation-input.sdnc-request-header.` " />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$security-zone-topology-operation-input.service-information.` " />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$security-zone-topology-operation-input.allotted-resource-information.` " />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.security-zone-request-input.' value="`$security-zone-topology-operation-input.security-zone-request-input.` " />
+ </set>
+ <set>
+ <parameter name='sz-ar-identifiers.consuming-service-instance-id' value="`$security-zone-topology-operation-input.service-information.service-instance-id` " />
+ <parameter name='sz-ar-identifiers.parent-service-instance-id' value="`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id` " />
+ <parameter name='sz-ar-identifiers.allotted-resource-type' value="`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-type` " />
+ <parameter name='sz-ar-identifiers.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ </set>
+ <set>
+ <parameter name='sz-ar.allotted-resource-data.security-zone-topology.onap-model-information.'
+value="`$security-zone-topology-operation-input.allotted-resource-information.onap-model-information.`" />
+ </set>
+ <switch test='$security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-invariant-uuid'>
+ <outcome value=''>
+ <set>
+ <parameter name='sz-ar.allotted-resource-data.security-zone-topology.onap-model-information.model-invariant-uuid'
+value="`$ar-model.invariant-uuid`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='$security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-uuid'>
+ <outcome value=''>
+ <set>
+ <parameter name='sz-ar.allotted-resource-data.security-zone-topology.onap-model-information.model-uuid'
+value="`$ar-model.uuid`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='$security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-version'>
+ <outcome value=''>
+ <set>
+ <parameter name='sz-ar.allotted-resource-data.security-zone-topology.onap-model-information.model-version'
+value="`$ar-model.version`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$ar-model.ecomp-generated-naming`'>
+ <outcome value='Y'>
+ <block atomic="true">
+ <switch test='`$ar-model.naming-policy`'>
+ <outcome value='oam_security_zone_name'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.ar-name' value='$TenantOAMNetworkRole_$LandingNetworkRole_SZ' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$TenantOAMNetworkRole"/>
+ <parameter name="replacement" value="`$security-zone-topology-operation-input.security-zone-request-input.untrusted-network-role`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$LandingNetworkRole"/>
+ <parameter name="replacement" value="`$security-zone-topology-operation-input.security-zone-request-input.trusted-network-role`"/>
+ </execute>
+ <set>
+ <parameter name='sz-ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.ar-name' value='$TenantOAMNetworkRole_$LandingNetworkRole_SZ' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$TenantOAMNetworkRole"/>
+ <parameter name="replacement" value="`$security-zone-topology-operation-input.security-zone-request-input.untrusted-network-role`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$LandingNetworkRole"/>
+ <parameter name="replacement" value="`$security-zone-topology-operation-input.security-zone-request-input.trusted-network-role`"/>
+ </execute>
+ <set>
+ <parameter name='sz-ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </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="Error in allotted-resource-model data. Ecomp-generated-naming should be true" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='sz-ar.allotted-resource-data.security-zone-topology.allotted-resource-identifiers.'
+value="`$sz-ar-identifiers.`" />
+ </set>
+ <set>
+ <parameter name='sz-ar-assignments.vlan-tag' value="`$security-zone-topology-operation-input.security-zone-request-input.vlan-tag` " />
+ <parameter name='sz-ar-assignments.trusted-network-role' value="`$security-zone-topology-operation-input.security-zone-request-input.trusted-network-role` " />
+ <parameter name='sz-ar-assignments.untrusted-network-role' value="`$security-zone-topology-operation-input.security-zone-request-input.untrusted-network-role` " />
+ <parameter name='sz-ar-assignments.security-zone-service-instance-id' value="`$tmp.ar.parent-service-instance-id` " />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='generate-panorama-name' mode='sync' ></call>
+ <set>
+ <parameter name='sz-ar-assignments.security-zone-name-untrusted' value="`$tmp.untrust-sz` " />
+ <parameter name='sz-ar-assignments.security-zone-name-trusted' value="`$tmp.trust-sz` " />
+ </set>
+ <set>
+ <parameter name='sz-ar.allotted-resource-data.security-zone-topology.security-zone-assignments.'
+value="`$sz-ar-assignments.`" />
+ </set>
+ <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.cidx' value="`0`" />
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value="1" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='cidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' >
+ <switch test="`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].allotted-resource-id == $tmp.ar.allotted-resource-id`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.cidx' value='`$cidx`' />
+ <parameter name='ctx.consumed-ar.' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].`' />
+ <parameter name='tmp.found-cidx' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.found-cidx`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.cidx' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-type' value="`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-type` " />
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-pointer' value="`$tmp.ar.self-link` " />
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value='`$tmp.cidx + 1`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingCreate' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$security-zone-topology-operation-input.request-information.request-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-request-id`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="description" value="`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-type`" />
+ <parameter name="selflink" value="`$tmp.ar.self-link`" />
+ <parameter name="model-invariant-id" value="`$ar-model.invariant-uuid`" />
+ <parameter name="model-version-id" value="`$ar-model.uuid`" />
+ <parameter name="operational-status" value="null" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </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="AAI failed" />
+ </return>
+ </outcome>
+ </update>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="parent" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </execute>
+ </block>
+ </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 updating md-sal for security-zone-allotted-resource" />
+ </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="Error updating md-sal for security-zone-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+ <parameter name='security-zone-object-path' value="`$tmp.ar.self-link`"/>
+ <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $security-zone-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-create.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-create.xml
index a0f09c99..a234d0d8 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-create.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-create.xml
@@ -1,100 +1,127 @@
-<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='security-zone-topology-operation-create' mode='sync'>
-<block atomic="true"><set>
-<parameter name='tmp.ar.allotted-resource-id' value='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
-<parameter name='tmp.ar.parent-service-instance-id' value='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
-<parameter name='tmp.ar.sz-vnf-id' value='`$security-zone-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' />
-
-
-</set><set>
-<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:security-zone-allotted-resources/security-zone-allotted-resource/'
- + $tmp.ar.allotted-resource-id
- + '/allotted-resource-data/security-zone-topology/'` " />
-
-</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
- <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
- <parameter name='contextPrefix' value='prop' />
-</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/>
- <parameter name="outputPath" value="tmp.ar-url"/>
- <parameter name="target" value="{allotted-resource-id}"/>
- <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
-</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='GET' />
- <parameter name="responsePrefix" value="mdsal-ar" />
-
-<outcome value='success'>
-<block atomic="true">
-<set>
-<parameter name='bk-sz-ar' value='$mdsal-ar.' />
-</set><switch test='`$mdsal-ar.security-zone-allotted-resource_length`'>
-<outcome value='1'>
-<block atomic='true'>
-<set>
-<parameter name='sz-ar.' value='$mdsal-ar.security-zone-allotted-resource[0].' />
-</set><switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
-<outcome value='PendingCreate'>
-<block>
-</block></outcome><outcome value='Other'>
-<block>
-</block></outcome></switch><set>
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
-
-</set></block></outcome></switch></block></outcome><outcome value='Other'>
-<block atomic="true">
-</block></outcome></execute><set>
-<parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
-<parameter name='sz-ar.allotted-resource-status.action' value="`$security-zone-topology-operation-input.request-information.request-action` " />
-<parameter name='sz-ar.allotted-resource-status.rpc-name' value="security-zone-topology-operation" />
-<parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$security-zone-topology-operation-input.sdnc-request-header.svc-action` " />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$security-zone-topology-operation-input.request-information.` " />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$security-zone-topology-operation-input.sdnc-request-header.` " />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$security-zone-topology-operation-input.service-information.` " />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$security-zone-topology-operation-input.allotted-resource-information.` " />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.security-zone-request-input.' value="`$security-zone-topology-operation-input.security-zone-request-input.` " /></set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
- <parameter name="outputPath" value="tmp.current-time" />
-
-</execute><set>
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Created' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$security-zone-topology-operation-input.request-information.request-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-request-id`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
-</set><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='PUT' />
- <parameter name="responsePrefix" value="mdsal-ar" />
-
-<outcome value='success'>
-<block>
-</block></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 updating md-sal for security-zone-allotted-resource" />
-</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="Error updating md-sal for security-zone-allotted-resource" />
-</return></outcome></execute><set>
-<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
-<parameter name='security-zone-object-path' value="`$tmp.ar.self-link`"/>
-<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
- + $security-zone-topology-operation-input.service-information.service-instance-id
- + '/service-data/service-topology/'`"/>
-
-</set><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>
+<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='security-zone-topology-operation-create' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ar.allotted-resource-id' value='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+ <parameter name='tmp.ar.parent-service-instance-id' value='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+ <parameter name='tmp.ar.sz-vnf-id' value='`$security-zone-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:security-zone-allotted-resources/security-zone-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/security-zone-topology/'` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='bk-sz-ar' value='$mdsal-ar.' />
+ </set>
+ <switch test='`$mdsal-ar.security-zone-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name='sz-ar.' value='$mdsal-ar.security-zone-allotted-resource[0].' />
+ </set>
+ <switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+ <outcome value='PendingCreate'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <parameter name='sz-ar.allotted-resource-status.action' value="`$security-zone-topology-operation-input.request-information.request-action` " />
+ <parameter name='sz-ar.allotted-resource-status.rpc-name' value="security-zone-topology-operation" />
+ <parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$security-zone-topology-operation-input.sdnc-request-header.svc-action` " />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$security-zone-topology-operation-input.request-information.` " />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$security-zone-topology-operation-input.sdnc-request-header.` " />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$security-zone-topology-operation-input.service-information.` " />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$security-zone-topology-operation-input.allotted-resource-information.` " />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.security-zone-request-input.' value="`$security-zone-topology-operation-input.security-zone-request-input.` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Created' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$security-zone-topology-operation-input.request-information.request-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-request-id`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block></block>
+ </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 updating md-sal for security-zone-allotted-resource" />
+ </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="Error updating md-sal for security-zone-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+ <parameter name='security-zone-object-path' value="`$tmp.ar.self-link`"/>
+ <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $security-zone-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-deactivate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-deactivate.xml
index 8fc45ac6..14ecf296 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-deactivate.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-deactivate.xml
@@ -1,118 +1,150 @@
-<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='security-zone-topology-operation-deactivate' mode='sync'>
-<block atomic="true"><set>
-<parameter name='tmp.ar.allotted-resource-id' value='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
-<parameter name='tmp.ar.parent-service-instance-id' value='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
-<parameter name='tmp.ar.sz-vnf-id' value='`$security-zone-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' />
-
-
-</set><set>
-<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:security-zone-allotted-resources/security-zone-allotted-resource/'
- + $tmp.ar.allotted-resource-id
- + '/allotted-resource-data/security-zone-topology/'` " />
-
-</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
- <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
- <parameter name='contextPrefix' value='prop' />
-</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/>
- <parameter name="outputPath" value="tmp.ar-url"/>
- <parameter name="target" value="{allotted-resource-id}"/>
- <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
-</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='GET' />
- <parameter name="responsePrefix" value="mdsal-ar" />
-
-<outcome value='success'>
-<block atomic="true">
-<set>
-<parameter name='bk-sz-ar' value='$mdsal-ar.' />
-</set><switch test='`$mdsal-ar.security-zone-allotted-resource_length`'>
-<outcome value='1'>
-<block atomic='true'>
-<set>
-<parameter name='sz-ar.' value='$mdsal-ar.security-zone-allotted-resource[0].' />
-</set><switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
-<outcome value='Created'>
-<block>
-</block></outcome><outcome value='Other'>
-<block>
-</block></outcome></switch><set>
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
-
-</set></block></outcome></switch></block></outcome><outcome value='Other'>
-<block atomic="true">
-</block></outcome></execute><set>
-<parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
-<parameter name='sz-ar.allotted-resource-status.action' value="`$security-zone-topology-operation-input.request-information.request-action` " />
-<parameter name='sz-ar.allotted-resource-status.rpc-name' value="security-zone-topology-operation" />
-<parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$security-zone-topology-operation-input.sdnc-request-header.svc-action` " />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$security-zone-topology-operation-input.request-information.` " />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$security-zone-topology-operation-input.sdnc-request-header.` " />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$security-zone-topology-operation-input.service-information.` " />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$security-zone-topology-operation-input.allotted-resource-information.` " />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.security-zone-request-input.' value="`$security-zone-topology-operation-input.security-zone-request-input.` " /></set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
- <parameter name="outputPath" value="tmp.current-time" />
-
-</execute><set>
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$security-zone-topology-operation-input.request-information.request-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-request-id`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
-</set><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="allotted-resource"
- key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
- service-subscription.service-type = $service-data.service-information.subscription-service-type AND
- service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
- allotted-resource.id = $tmp.ar.allotted-resource-id"
- pfx='pfx' local-only='false' force='false'>
- <parameter name="operational-status" value="out-of-service-path" />
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="AAI failed" />
-</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="AAI failed" />
-</return></outcome></update><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='PUT' />
- <parameter name="responsePrefix" value="mdsal-ar" />
-
-<outcome value='success'>
-<block>
-</block></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 updating md-sal for security-zone-allotted-resource" />
-</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="Error updating md-sal for security-zone-allotted-resource" />
-</return></outcome></execute><set>
-<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
-<parameter name='security-zone-object-path' value="`$tmp.ar.self-link`"/>
-<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
- + $security-zone-topology-operation-input.service-information.service-instance-id
- + '/service-data/service-topology/'`"/>
-
-</set><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>
+<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='security-zone-topology-operation-deactivate' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ar.allotted-resource-id' value='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+ <parameter name='tmp.ar.parent-service-instance-id' value='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+ <parameter name='tmp.ar.sz-vnf-id' value='`$security-zone-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:security-zone-allotted-resources/security-zone-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/security-zone-topology/'` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='bk-sz-ar' value='$mdsal-ar.' />
+ </set>
+ <switch test='`$mdsal-ar.security-zone-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name='sz-ar.' value='$mdsal-ar.security-zone-allotted-resource[0].' />
+ </set>
+ <switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+ <outcome value='Created'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <parameter name='sz-ar.allotted-resource-status.action' value="`$security-zone-topology-operation-input.request-information.request-action` " />
+ <parameter name='sz-ar.allotted-resource-status.rpc-name' value="security-zone-topology-operation" />
+ <parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$security-zone-topology-operation-input.sdnc-request-header.svc-action` " />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$security-zone-topology-operation-input.request-information.` " />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$security-zone-topology-operation-input.sdnc-request-header.` " />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$security-zone-topology-operation-input.service-information.` " />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$security-zone-topology-operation-input.allotted-resource-information.` " />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.security-zone-request-input.' value="`$security-zone-topology-operation-input.security-zone-request-input.` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$security-zone-topology-operation-input.request-information.request-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-request-id`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="operational-status" value="out-of-service-path" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </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="AAI failed" />
+ </return>
+ </outcome>
+ </update>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block></block>
+ </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 updating md-sal for security-zone-allotted-resource" />
+ </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="Error updating md-sal for security-zone-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+ <parameter name='security-zone-object-path' value="`$tmp.ar.self-link`"/>
+ <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $security-zone-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-delete.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-delete.xml
index 4b78a629..acad449d 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-delete.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-delete.xml
@@ -1,105 +1,130 @@
-<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='security-zone-topology-operation-delete' mode='sync'>
-<block atomic="true"><set>
-<parameter name='tmp.ar.allotted-resource-id' value='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
-<parameter name='tmp.ar.parent-service-instance-id' value='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
-<parameter name='tmp.ar.sz-vnf-id' value='`$security-zone-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' />
-
-
-</set><set>
-<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:security-zone-allotted-resources/security-zone-allotted-resource/'
- + $tmp.ar.allotted-resource-id
- + '/allotted-resource-data/security-zone-topology/'` " />
-
-</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
- <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
- <parameter name='contextPrefix' value='prop' />
-</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/>
- <parameter name="outputPath" value="tmp.ar-url"/>
- <parameter name="target" value="{allotted-resource-id}"/>
- <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
-</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='GET' />
- <parameter name="responsePrefix" value="mdsal-ar" />
-
-<outcome value='success'>
-<block atomic="true">
-<set>
-<parameter name='bk-sz-ar' value='$mdsal-ar.' />
-</set><switch test='`$mdsal-ar.security-zone-allotted-resource_length`'>
-<outcome value='1'>
-<block atomic='true'>
-<set>
-<parameter name='sz-ar.' value='$mdsal-ar.security-zone-allotted-resource[0].' />
-</set><switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
-<outcome value='Created'>
-<block>
-</block></outcome><outcome value='Other'>
-<block>
-</block></outcome></switch><set>
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
-
-</set></block></outcome></switch></block></outcome><outcome value='Other'>
-<block atomic="true">
-</block></outcome></execute><set>
-<parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
-<parameter name='sz-ar.allotted-resource-status.action' value="`$security-zone-topology-operation-input.request-information.request-action` " />
-<parameter name='sz-ar.allotted-resource-status.rpc-name' value="security-zone-topology-operation" />
-<parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$security-zone-topology-operation-input.sdnc-request-header.svc-action` " />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$security-zone-topology-operation-input.request-information.` " />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$security-zone-topology-operation-input.sdnc-request-header.` " />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$security-zone-topology-operation-input.service-information.` " />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$security-zone-topology-operation-input.allotted-resource-information.` " />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.security-zone-request-input.' value="`$security-zone-topology-operation-input.security-zone-request-input.` " /></set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
- <parameter name="outputPath" value="tmp.current-time" />
-
-</execute><set>
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$security-zone-topology-operation-input.request-information.request-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-request-id`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
-</set><set>
-<parameter name='sz-ar-assignments.' value="" />
-
-
-
-</set><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='PUT' />
- <parameter name="responsePrefix" value="mdsal-ar" />
-
-<outcome value='success'>
-<block>
-</block></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 updating md-sal for security-zone-allotted-resource" />
-</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="Error updating md-sal for security-zone-allotted-resource" />
-</return></outcome></execute><set>
-<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
-<parameter name='security-zone-object-path' value="`$tmp.ar.self-link`"/>
-<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
- + $security-zone-topology-operation-input.service-information.service-instance-id
- + '/service-data/service-topology/'`"/>
-
-</set><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>
+<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='security-zone-topology-operation-delete' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ar.allotted-resource-id' value='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+ <parameter name='tmp.ar.parent-service-instance-id' value='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+ <parameter name='tmp.ar.sz-vnf-id' value='`$security-zone-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:security-zone-allotted-resources/security-zone-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/security-zone-topology/'` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='bk-sz-ar' value='$mdsal-ar.' />
+ </set>
+ <switch test='`$mdsal-ar.security-zone-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name='sz-ar.' value='$mdsal-ar.security-zone-allotted-resource[0].' />
+ </set>
+ <switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+ <outcome value='Created'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <parameter name='sz-ar.allotted-resource-status.action' value="`$security-zone-topology-operation-input.request-information.request-action` " />
+ <parameter name='sz-ar.allotted-resource-status.rpc-name' value="security-zone-topology-operation" />
+ <parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$security-zone-topology-operation-input.sdnc-request-header.svc-action` " />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$security-zone-topology-operation-input.request-information.` " />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$security-zone-topology-operation-input.sdnc-request-header.` " />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$security-zone-topology-operation-input.service-information.` " />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$security-zone-topology-operation-input.allotted-resource-information.` " />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.security-zone-request-input.' value="`$security-zone-topology-operation-input.security-zone-request-input.` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$security-zone-topology-operation-input.request-information.request-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$security-zone-topology-operation-input.sdnc-request-header.svc-request-id`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <set>
+ <parameter name='sz-ar-assignments.' value="" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block></block>
+ </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 updating md-sal for security-zone-allotted-resource" />
+ </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="Error updating md-sal for security-zone-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+ <parameter name='security-zone-object-path' value="`$tmp.ar.self-link`"/>
+ <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $security-zone-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-unassign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-unassign.xml
index 872ddbdb..0f11b39c 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-unassign.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation-unassign.xml
@@ -1,81 +1,105 @@
-<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='security-zone-topology-operation-unassign' mode='sync'>
-<block atomic="true"><set>
-<parameter name='tmp.ar.allotted-resource-id' value='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
-<parameter name='tmp.ar.parent-service-instance-id' value='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
-<parameter name='tmp.ar.sz-vnf-id' value='`$security-zone-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' />
-
-
-</set><set>
-<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:security-zone-allotted-resources/security-zone-allotted-resource/'
- + $tmp.ar.allotted-resource-id
- + '/allotted-resource-data/security-zone-topology/'` " />
-
-</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
- <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
- <parameter name='contextPrefix' value='prop' />
-</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/>
- <parameter name="outputPath" value="tmp.ar-url"/>
- <parameter name="target" value="{allotted-resource-id}"/>
- <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
-</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='GET' />
- <parameter name="responsePrefix" value="mdsal-ar" />
-
-<outcome value='success'>
-<block atomic="true">
-<set>
-<parameter name='bk-sz-ar' value='$mdsal-ar.' />
-</set><switch test='`$mdsal-ar.security-zone-allotted-resource_length`'>
-<outcome value='1'>
-<block atomic='true'>
-<set>
-<parameter name='sz-ar.' value='$mdsal-ar.security-zone-allotted-resource[0].' />
-</set><switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
-<outcome value='Created'>
-<block>
-</block></outcome><outcome value='Other'>
-<block>
-</block></outcome></switch><set>
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
-<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
-
-</set></block></outcome></switch></block></outcome><outcome value='Other'>
-<block atomic="true">
-</block></outcome></execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='DELETE' />
- <parameter name="responsePrefix" value="mdsal-ar" />
-
-<outcome value='success'>
-<block>
-</block></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 updating md-sal for security-zone-allotted-resource" />
-</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="Error updating md-sal for security-zone-allotted-resource" />
-</return></outcome></execute><set>
-<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
-<parameter name='security-zone-object-path' value="`$tmp.ar.self-link`"/>
-<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
- + $security-zone-topology-operation-input.service-information.service-instance-id
- + '/service-data/service-topology/'`"/>
-
-</set><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>
+<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='security-zone-topology-operation-unassign' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ar.allotted-resource-id' value='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+ <parameter name='tmp.ar.parent-service-instance-id' value='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+ <parameter name='tmp.ar.sz-vnf-id' value='`$security-zone-topology-operation-input.allotted-resource-data.security-zone-topology.security-zone-assignments.security-zone-vnf-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:security-zone-allotted-resources/security-zone-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/security-zone-topology/'` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='bk-sz-ar' value='$mdsal-ar.' />
+ </set>
+ <switch test='`$mdsal-ar.security-zone-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name='sz-ar.' value='$mdsal-ar.security-zone-allotted-resource[0].' />
+ </set>
+ <switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+ <outcome value='Created'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
+ <parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block></block>
+ </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 updating md-sal for security-zone-allotted-resource" />
+ </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="Error updating md-sal for security-zone-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+ <parameter name='security-zone-object-path' value="`$tmp.ar.self-link`"/>
+ <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $security-zone-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation.xml
index 41f84c51..5cb18ae4 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_security-zone-topology-operation.xml
@@ -1,26 +1,56 @@
-<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='security-zone-topology-operation' mode='sync'>
-<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='validate-security-zone-input' mode='sync' >
-</call><switch test='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`'>
-<outcome value='assign'>
-<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='security-zone-topology-operation-assign' mode='sync' >
-</call></block></outcome><outcome value='create'>
-<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='security-zone-topology-operation-create' mode='sync' >
-</call></block></outcome><outcome value='activate'>
-<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='security-zone-topology-operation-activate' mode='sync' >
-</call></block></outcome><outcome value='deactivate'>
-<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='security-zone-topology-operation-deactivate' mode='sync' >
-</call></block></outcome><outcome value='delete'>
-<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='security-zone-topology-operation-delete' mode='sync' >
-</call></block></outcome><outcome value='unassign'>
-<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='security-zone-topology-operation-unassign' mode='sync' >
-</call></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="sdnc-request-header.svc-action is a required input" />
-</return></outcome></switch><set>
-<parameter name="ack-final" value="Y"/></set><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>
+<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='security-zone-topology-operation' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-security-zone-input' mode='sync' ></call>
+ <switch test='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='security-zone-topology-operation-assign' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='create'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='security-zone-topology-operation-create' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='activate'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='security-zone-topology-operation-activate' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='deactivate'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='security-zone-topology-operation-deactivate' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='delete'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='security-zone-topology-operation-delete' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='unassign'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='security-zone-topology-operation-unassign' mode='sync' ></call>
+ </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="sdnc-request-header.svc-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="ack-final" value="Y"/>
+ </set>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-aai-vfmodule-put.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-aai-vfmodule-put.xml
new file mode 100644
index 00000000..0ca7cde5
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-aai-vfmodule-put.xml
@@ -0,0 +1,171 @@
+<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='self-serve-aai-vfmodule-put' mode='sync'>
+ <block atomic='true'>
+ <switch test='`$vnf-index`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='vnf-index is required' />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for index="k" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`" >
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$k].name`'>
+ <outcome value='vnf-id'>
+ <block>
+ <set>
+ <parameter name='vnf-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$k].value`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='ipv4-loopback0-address'>
+ <block>
+ <set>
+ <parameter name='ipv4-loopback0-address' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$k].value`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='as-number'>
+ <block>
+ <set>
+ <parameter name='as-number' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$k].value`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='vlan-id-outer'>
+ <block>
+ <set>
+ <parameter name='vlan-id-outer' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$k].value`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <for index="j" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`" >
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$j].name`'>
+ <outcome value='vf-module-id'>
+ <set>
+ <parameter name='vf-module-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$j].value`' />
+ </set>
+ </outcome>
+ <outcome value='vf-module-name'>
+ <set>
+ <parameter name='vf-module-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$j].value`' />
+ </set>
+ </outcome>
+ <outcome value='volume-group-id'>
+ <set>
+ <parameter name='volume-group-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$j].value`' />
+ </set>
+ </outcome>
+ <outcome value='volume-group-name'>
+ <set>
+ <parameter name='volume-group-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$j].value`' />
+ </set>
+ </outcome>
+ <outcome value='cloud-region'>
+ <set>
+ <parameter name='cloud-region' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$j].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <block>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $vnf-id "
+ pfx="tmp.AnAI-data.vnf" >
+ <parameter name="ipv4-loopback0-address" value='`$ipv4-loopback0-address`' />
+ <parameter name="ipv4-oam-address" value='`$ipv4-oam-address`' />
+ <parameter name="as-number" value='`$as-number`' />
+ <parameter name="vlan-id-outer" value='`$vlan-id-outer`' />
+ <outcome value='failure'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log" />
+ <parameter name="level" value="error" />
+ <parameter name="field1" value="Error for PUT in AAI for generic-vnf." />
+ <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
+ <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
+ </record>
+ </outcome>
+ <outcome value='not-found'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log" />
+ <parameter name="level" value="error" />
+ <parameter name="field1" value="Error for PUT in AAI for generic-vnf." />
+ <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
+ <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
+ </record>
+ </outcome>
+ <outcome value='success'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vf-module"
+ key="vf-module.vf-module-id = $vf-module-id "
+ pfx="tmp.AnAI-data.vfmodule" >
+ <parameter name="vf-module-name" value='`$vf-module-name`' />
+ <outcome value='failure'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log" />
+ <parameter name="level" value="error" />
+ <parameter name="field1" value="Error for PUT in AAI for vf-module" />
+ <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
+ <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
+ </record>
+ </outcome>
+ <outcome value='not-found'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log" />
+ <parameter name="level" value="error" />
+ <parameter name="field1" value="Error for PUT in AAI for vf-module" />
+ <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
+ <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
+ </record>
+ </outcome>
+ <outcome value='success'>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="volume-group"
+ key="volume-group-id = $volume-group-id and
+ cloud-region.cloud-owner = $prop.cloud-region.cloud-owner and
+ cloud-region.cloud-region-id = $cloud-region "
+ pfx="tmp.AnAI-data.vnf" >
+ <parameter name="volume-group-name" value='`$volume-group-name`' />
+ <outcome value='failure'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log" />
+ <parameter name="level" value="error" />
+ <parameter name="field1" value="Error Saving in AAI" />
+ <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
+ <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
+ </record>
+ </outcome>
+ <outcome value='not-found'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log" />
+ <parameter name="level" value="error" />
+ <parameter name="field1" value="Error Saving in AAI" />
+ <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
+ <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
+ </record>
+ </outcome>
+ <outcome value='success'>
+ <return status='success'></return>
+ </outcome>
+ </update>
+ </outcome>
+ </update>
+ </outcome>
+ </update>
+ </block>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-alts-assignment.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-alts-assignment.xml
new file mode 100644
index 00000000..c26b6664
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-alts-assignment.xml
@@ -0,0 +1,653 @@
+<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='self-serve-alts-assignment' mode='sync'>
+ <block>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-capability-param-resolution' mode='sync' ></call>
+ <switch test='`$ss.capability-name`'>
+ <outcome value='alts-license-assign'>
+ <switch test='`$ss.capability-action`'>
+ <outcome value='assign'>
+ <block atomic='true'>
+ <switch test='`$vnf-index`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='vnf-index is required' />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for index="i" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`" >
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.capability-name`'>
+ <outcome value='alts-license-assign'>
+ <block>
+ <set>
+ <parameter name='license-param-index' value='`$i`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='alts-entitlement-assign'>
+ <block>
+ <set>
+ <parameter name='entitlement-param-index' value='`$i`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <for index="k" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`" >
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$k].name`'>
+ <outcome value='license-key'>
+ <block>
+ <set>
+ <parameter name='license-key-index' value='`$k`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='entitlement-key'>
+ <block>
+ <set>
+ <parameter name='entitlement-key-index' value='`$k`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$ss.capability-name`'>
+ <outcome value='alts-license-assign'>
+ <set>
+ <parameter name='param-index' value='`$license-param-index`' />
+ </set>
+ </outcome>
+ <outcome value='alts-entitlement-assign'>
+ <set>
+ <parameter name='param-index' value='`$entitlement-param-index`' />
+ </set>
+ </outcome>
+ </switch>
+ <for index="j" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key_length`" >
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].name`'>
+ <outcome value='vnf-id'>
+ <set>
+ <parameter name='alts.vnf-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
+ </set>
+ </outcome>
+ <outcome value='vnf_name'>
+ <set>
+ <parameter name='alts.vnf-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
+ </set>
+ </outcome>
+ <outcome value='license-assignment-group-uuid'>
+ <set>
+ <parameter name='alts.license-assignment-group-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
+ </set>
+ </outcome>
+ <outcome value='entitlement-assignment-group-uuid'>
+ <set>
+ <parameter name='alts.entitlement-assignment-group-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin="com.att.sdnctl.sli.plugin.altsTools.AltsTools" method="acquireLicense" >
+ <parameter name="error-prefix" value="alts.error" />
+ <parameter name="prefix" value="alts.resp" />
+ <parameter name="assignment-group" value="`$alts.license-assignment-group-uuid`" />
+ <parameter name="hostname" value="`$alts.vnf-name`" />
+ <parameter name="vnf-id" value="`$alts.vnf-id`" />
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$license-key-index].value' value='`$alts.resp.license-key`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.status' value='SUCCESS' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="license"
+ key="generic-vnf.vnf-id = $alts.vnf-id
+ AND license.group-uuid = $alts.license-assignment-group-uuid
+ AND license.resource-uuid = $alts.resp.license-key"
+ pfx="tmp.AnAI.license" >
+ <parameter name="group-uuid" value='`$alts.license-assignment-group-uuid`' />
+ <parameter name="resource-uuid" value='`$alts.resp.license-key`' />
+ <outcome value='failure'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log" />
+ <parameter name="level" value="error" />
+ <parameter name="field1" value="Error Saving in AAI" />
+ <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
+ <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
+ </record>
+ </outcome>
+ <outcome value='not-found'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log" />
+ <parameter name="level" value="error" />
+ <parameter name="field1" value="Error Saving in AAI" />
+ <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
+ <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
+ </record>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value="failure">
+ <block>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="unsupported-method">
+ <block>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='unassign'>
+ <block atomic='true'>
+ <switch test='`$vnf-index`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='vnf-index is required' />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for index="i" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`" >
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.capability-name`'>
+ <outcome value='alts-license-assign'>
+ <block>
+ <set>
+ <parameter name='license-param-index' value='`$i`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='alts-entitlement-assign'>
+ <block>
+ <set>
+ <parameter name='entitlement-param-index' value='`$i`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <for index="k" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`" >
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$k].name`'>
+ <outcome value='license-key'>
+ <block>
+ <set>
+ <parameter name='license-key-index' value='`$k`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='entitlement-key'>
+ <block>
+ <set>
+ <parameter name='entitlement-key-index' value='`$k`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$ss.capability-name`'>
+ <outcome value='alts-license-assign'>
+ <set>
+ <parameter name='param-index' value='`$license-param-index`' />
+ </set>
+ </outcome>
+ <outcome value='alts-entitlement-assign'>
+ <set>
+ <parameter name='param-index' value='`$entitlement-param-index`' />
+ </set>
+ </outcome>
+ </switch>
+ <for index="j" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key_length`" >
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].name`'>
+ <outcome value='vnf-id'>
+ <set>
+ <parameter name='alts.vnf-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
+ </set>
+ </outcome>
+ <outcome value='vnf_name'>
+ <set>
+ <parameter name='alts.vnf-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
+ </set>
+ </outcome>
+ <outcome value='license-assignment-group-uuid'>
+ <set>
+ <parameter name='alts.license-assignment-group-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
+ </set>
+ </outcome>
+ <outcome value='entitlement-assignment-group-uuid'>
+ <set>
+ <parameter name='alts.entitlement-assignment-group-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin="com.att.sdnctl.sli.plugin.altsTools.AltsTools" method="releaseLicense" >
+ <parameter name="asset-uuid" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$license-key-index].value`" />
+ <parameter name="error-prefix" value="alts.error" />
+ <parameter name="prefix" value="alts.resp" />
+ <parameter name="assignment-group" value="`$alts.license-assignment-group-uuid`" />
+ <parameter name="hostname" value="`$alts.vnf-name`" />
+ <parameter name="vnf-id" value="`$alts.vnf-id`" />
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.status' value='DELETED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+resource="license"
+key="generic-vnf.vnf-id = $alts.vnf-id "
+force="true"
+local-only="false"
+pfx="tmp.AnAI-data.vnf" >
+ <parameter name="group-uuid" value='' />
+ <parameter name="resource-uuid" value='' />
+ <outcome value='failure'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log" />
+ <parameter name="level" value="error" />
+ <parameter name="field1" value="Error updating in AAI" />
+ <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
+ <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
+ </record>
+ </outcome>
+ <outcome value='not-found'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log" />
+ <parameter name="level" value="error" />
+ <parameter name="field1" value="Error updating in AAI" />
+ <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
+ <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
+ </record>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ <outcome value="failure">
+ <block>
+ <return status='failure'>
+ <parameter name='error-code' value='`$alts.error.error-code`' />
+ <parameter name='error-message' value='`$alts.error.error-message`' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block>
+ <return status='failure'>
+ <parameter name='error-code' value='`$alts.error.error-code`' />
+ <parameter name='error-message' value='`$alts.error.error-message`' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value="unsupported-method">
+ <block>
+ <return status='failure'>
+ <parameter name='error-code' value='`$alts.error.error-code`' />
+ <parameter name='error-message' value='`$alts.error.error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='alts-entitlement-assign'>
+ <switch test='`$ss.capability-action`'>
+ <outcome value='assign'>
+ <block atomic='true'>
+ <switch test='`$vnf-index`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='vnf-index is required' />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for index="i" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`" >
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.capability-name`'>
+ <outcome value='alts-license-assign'>
+ <block>
+ <set>
+ <parameter name='license-param-index' value='`$i`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='alts-entitlement-assign'>
+ <block>
+ <set>
+ <parameter name='entitlement-param-index' value='`$i`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <for index="k" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`" >
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$k].name`'>
+ <outcome value='license-key'>
+ <block>
+ <set>
+ <parameter name='license-key-index' value='`$k`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='entitlement-key'>
+ <block>
+ <set>
+ <parameter name='entitlement-key-index' value='`$k`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$ss.capability-name`'>
+ <outcome value='alts-license-assign'>
+ <set>
+ <parameter name='param-index' value='`$license-param-index`' />
+ </set>
+ </outcome>
+ <outcome value='alts-entitlement-assign'>
+ <set>
+ <parameter name='param-index' value='`$entitlement-param-index`' />
+ </set>
+ </outcome>
+ </switch>
+ <for index="j" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key_length`" >
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].name`'>
+ <outcome value='vnf-id'>
+ <set>
+ <parameter name='alts.vnf-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
+ </set>
+ </outcome>
+ <outcome value='vnf_name'>
+ <set>
+ <parameter name='alts.vnf-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
+ </set>
+ </outcome>
+ <outcome value='license-assignment-group-uuid'>
+ <set>
+ <parameter name='alts.license-assignment-group-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
+ </set>
+ </outcome>
+ <outcome value='entitlement-assignment-group-uuid'>
+ <set>
+ <parameter name='alts.entitlement-assignment-group-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin="com.att.sdnctl.sli.plugin.altsTools.AltsTools" method="acquireEntitlement" >
+ <parameter name="error-prefix" value="alts.error" />
+ <parameter name="prefix" value="alts.resp" />
+ <parameter name="assignment-group" value="`$alts.entitlement-assignment-group-uuid`" />
+ <parameter name="hostname" value="`$alts.vnf-name`" />
+ <parameter name="vnf-id" value="`$alts.vnf-id`" />
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$entitlement-key-index].value' value='`$alts.resp.license-key`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.status' value='SUCCESS' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="entitlement"
+ key="generic-vnf.vnf-id = $alts.vnf-id
+ AND entitlement.group-uuid = $alts.entitlement-assignment-group-uuid
+ AND entitlement.resource-uuid = $alts.resp.license-key "
+ pfx="tmp.AnAI.entitlement" >
+ <parameter name="group-uuid" value='`$alts.entitlement-assignment-group-uuid`' />
+ <parameter name="resource-uuid" value='`$alts.resp.license-key`' />
+ <outcome value='failure'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log" />
+ <parameter name="level" value="error" />
+ <parameter name="field1" value="Error Saving in AAI" />
+ <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
+ <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
+ </record>
+ </outcome>
+ <outcome value='not-found'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log" />
+ <parameter name="level" value="error" />
+ <parameter name="field1" value="Error Saving in AAI" />
+ <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
+ <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
+ </record>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value="failure">
+ <block>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value="unsupported-method">
+ <block>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='unassign'>
+ <block atomic='true'>
+ <switch test='`$vnf-index`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='vnf-index is required' />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for index="i" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`" >
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.capability-name`'>
+ <outcome value='alts-license-assign'>
+ <block>
+ <set>
+ <parameter name='license-param-index' value='`$i`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='alts-entitlement-assign'>
+ <block>
+ <set>
+ <parameter name='entitlement-param-index' value='`$i`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <for index="k" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`" >
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$k].name`'>
+ <outcome value='license-key'>
+ <block>
+ <set>
+ <parameter name='license-key-index' value='`$k`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='entitlement-key'>
+ <block>
+ <set>
+ <parameter name='entitlement-key-index' value='`$k`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$ss.capability-name`'>
+ <outcome value='alts-license-assign'>
+ <set>
+ <parameter name='param-index' value='`$license-param-index`' />
+ </set>
+ </outcome>
+ <outcome value='alts-entitlement-assign'>
+ <set>
+ <parameter name='param-index' value='`$entitlement-param-index`' />
+ </set>
+ </outcome>
+ </switch>
+ <for index="j" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key_length`" >
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].name`'>
+ <outcome value='vnf-id'>
+ <set>
+ <parameter name='alts.vnf-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
+ </set>
+ </outcome>
+ <outcome value='vnf_name'>
+ <set>
+ <parameter name='alts.vnf-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
+ </set>
+ </outcome>
+ <outcome value='license-assignment-group-uuid'>
+ <set>
+ <parameter name='alts.license-assignment-group-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
+ </set>
+ </outcome>
+ <outcome value='entitlement-assignment-group-uuid'>
+ <set>
+ <parameter name='alts.entitlement-assignment-group-uuid' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.resource-key[$j].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin="com.att.sdnctl.sli.plugin.altsTools.AltsTools" method="releaseEntitlement" >
+ <parameter name="asset-uuid" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$entitlement-key-index].value`" />
+ <parameter name="error-prefix" value="alts.error" />
+ <parameter name="prefix" value="alts.resp" />
+ <parameter name="assignment-group" value="`$alts.entitlement-assignment-group-uuid`" />
+ <parameter name="hostname" value="`$alts.vnf-name`" />
+ <parameter name="vnf-id" value="`$alts.vnf-id`" />
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$param-index].resource-resolution-data.status' value='DELETED' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+resource="license"
+key="generic-vnf.vnf-id = $alts.vnf-id "
+force="true"
+local-only="false"
+pfx="tmp.AnAI-data.vnf" >
+ <parameter name="group-uuid" value='' />
+ <parameter name="resource-uuid" value='' />
+ <outcome value='failure'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log" />
+ <parameter name="level" value="error" />
+ <parameter name="field1" value="Error updating in AAI" />
+ <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
+ <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
+ </record>
+ </outcome>
+ <outcome value='not-found'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log" />
+ <parameter name="level" value="error" />
+ <parameter name="field1" value="Error updating in AAI" />
+ <parameter name="field2" value="`$tmp.AnAI-data.vnf.error-code`" />
+ <parameter name="field3" value="`$tmp.AnAI-data.vnf.error-message`" />
+ </record>
+ </outcome>
+ </update>
+ </block>
+ </outcome>
+ <outcome value="failure">
+ <block>
+ <return status='failure'>
+ <parameter name='error-code' value='`$alts.error.error-code`' />
+ <parameter name='error-message' value='`$alts.error.error-message`' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block>
+ <return status='failure'>
+ <parameter name='error-code' value='`$alts.error.error-code`' />
+ <parameter name='error-message' value='`$alts.error.error-message`' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value="unsupported-method">
+ <block>
+ <return status='failure'>
+ <parameter name='error-code' value='`$alts.error.error-code`' />
+ <parameter name='error-message' value='`$alts.error.error-message`' />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-capability-param-resolution.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-capability-param-resolution.xml
new file mode 100644
index 00000000..cf3447f7
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-capability-param-resolution.xml
@@ -0,0 +1,192 @@
+<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='self-serve-capability-param-resolution' mode='sync'>
+ <block atomic='true'>
+ <switch test="`$ss.capability-type`">
+ <outcome value='vnf'>
+ <for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <for index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key_length`' >
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='true'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'SS: param[].value with leading $: ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='resource-resolution-split' />
+ <parameter name='original_string' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`' />
+ <parameter name='regex' value='\$\{' />
+ </execute>
+ <set>
+ <parameter name="tmp.s1" value='`$resource-resolution-split[0]`'/>
+ <parameter name="tmp.resolved.var.value" value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`'/>
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='s2' />
+ <parameter name='original_string' value='`$resource-resolution-split[1]`' />
+ <parameter name='regex' value='\}' />
+ </execute>
+ <switch test='`$s2_length`'>
+ <outcome value='1'>
+ <set>
+ <parameter name="tmp.s2.s1" value='`$s2[0]`'/>
+ </set>
+ </outcome>
+ <outcome value='2'>
+ <block>
+ <set>
+ <parameter name="tmp.s2.s1" value='`$s2[0]`'/>
+ </set>
+ <set>
+ <parameter name="tmp.s2.s2" value='`$s2[1]`'/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <for index='cn' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$cn].name == $tmp.s2.s1`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.resolved.var.value' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$cn].value`'/>
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='concat'>
+ <parameter name='source' value='`$tmp.s1`' />
+ <parameter name='target' value='`$tmp.resolved.var.value`' />
+ <parameter name='outputPath' value='tmp.result' />
+ </execute>
+ <switch test='`$tmp.s2.s2`'>
+ <outcome value=''></outcome>
+ <outcome value='Other'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='concat'>
+ <parameter name='source' value='`$tmp.result`' />
+ <parameter name='target' value='`$tmp.s2.s2`' />
+ <parameter name='outputPath' value='tmp.result' />
+ </execute>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`' value='`$tmp.result`'/>
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='true'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value= "`'Not able to resolve Capability ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name + ':' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value`" />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </execute>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='vf-module'>
+ <for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <for index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key_length`' >
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='true'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'SS: param[].value with leading $: ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value`"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='resource-resolution-split' />
+ <parameter name='original_string' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value`' />
+ <parameter name='regex' value='\$\{' />
+ </execute>
+ <set>
+ <parameter name="tmp.s1" value='`$resource-resolution-split[0]`'/>
+ <parameter name="tmp.resolved.var.value" value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value`'/>
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='s2' />
+ <parameter name='original_string' value='`$resource-resolution-split[1]`' />
+ <parameter name='regex' value='\}' />
+ </execute>
+ <switch test='`$s2_length`'>
+ <outcome value='1'>
+ <set>
+ <parameter name="tmp.s2.s1" value='`$s2[0]`'/>
+ </set>
+ </outcome>
+ <outcome value='2'>
+ <block>
+ <set>
+ <parameter name="tmp.s2.s1" value='`$s2[0]`'/>
+ </set>
+ <set>
+ <parameter name="tmp.s2.s2" value='`$s2[1]`'/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <for index='cn' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$cn].name == $tmp.s2.s1`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.resolved.var.value' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$cn].value`'/>
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='concat'>
+ <parameter name='source' value='`$tmp.s1`' />
+ <parameter name='target' value='`$tmp.resolved.var.value`' />
+ <parameter name='outputPath' value='tmp.result' />
+ </execute>
+ <switch test='`$tmp.s2.s2`'>
+ <outcome value=''></outcome>
+ <outcome value='Other'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='concat'>
+ <parameter name='source' value='`$tmp.result`' />
+ <parameter name='target' value='`$tmp.s2.s2`' />
+ <parameter name='outputPath' value='tmp.result' />
+ </execute>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value`' value='`$tmp.result`'/>
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='true'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value= "`'Not able to resolve Capability ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].name + ':' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value`" />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </execute>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-create-vpe-pool.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-create-vpe-pool.xml
new file mode 100755
index 00000000..800ded3f
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-create-vpe-pool.xml
@@ -0,0 +1,486 @@
+<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='self-serve-create-vpe-pool' mode='sync'>
+ <block atomic='true'>
+ <switch test="`$ss.capability-name`">
+ <outcome value='Other'></outcome>
+ <outcome value=''>
+ <block>
+ <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="self-serve-create-vpe-pool: ss.capability-name is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='401' />
+ <parameter name='error-message' value='ss.capability-name is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='null'></outcome>
+ <outcome value='create-vpe-pool'>
+ <record plugin="com.att.sdnctl.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-create-vpe-pool: ss.capability-name is create-vpe-pool"/>
+ </record>
+ </outcome>
+ </switch>
+ <switch test="`$ss.capability-action`">
+ <outcome value='Other'></outcome>
+ <outcome value=''>
+ <block>
+ <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="self-serve-create-vpe-pool: ss.capability-action is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='401' />
+ <parameter name='error-message' value='ss.capability-action is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='null'></outcome>
+ <outcome value='ASSIGN'>
+ <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="self-serve-create-vpe-pool: ss.capability-action is ASSIGN"/>
+ </record>
+ </outcome>
+ <outcome value='UNASSIGN'>
+ <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="self-serve-create-vpe-pool: ss.capability-action is UNASSIGN"/>
+ </record>
+ </outcome>
+ </switch>
+ <block atomic='true'>
+ <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="self-serve-create-vpe-pool: call self-service-capability-param-resolution DG"/>
+ </record>
+ <set>
+ <!--<parameter name='generate-unique-name-input.index-table-name' value='VM_NAME_INDEX' />-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-capability-param-resolution' mode='sync' >
+ <outcome value='failure'>
+ <block>
+ <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="self-serve-create-vpe-pool: Failure calling self-service-capability-param-resolution"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='402' />
+ <parameter name='error-message' value='Failure calling self-service-capability-param-resolution' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'></outcome>
+ </call>
+ </block>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.vf-module-parameters-length' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' />
+ </set>
+ <for index='vf-module-param-index' start='0' end='`$tmp.vf-module-parameters-length`' >
+ <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="self-serve-create-vpe-pool: vf-module-param-index"/>
+ <parameter name="field3" value='`$vf-module-param-index`'/>
+ </record>
+ <block>
+ <set>
+ <parameter name='vfModuleParamsCapabilityName' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test="`$ss.capability-name == $vfModuleParamsCapabilityName`">
+ <outcome value='true'>
+ <block>
+ <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="self-serve-create-vpe-pool: Found ss.capability-name MATCH"/>
+ </record>
+ <set>
+ <parameter name='tmp.resource-resolution-data.' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ <outcome value='false'></outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ <switch test="`$tmp.resource-resolution-data.status == 'PENDING'`">
+ <outcome value='false'>
+ <block>
+ <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="self-serve-create-vpe-pool: reseouce-resolution-data.status is not PENDING"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='401' />
+ <parameter name='error-message' value='reseouce-resolution-data.status is not PENDING' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.resource-key-length' value='`$tmp.resource-resolution-data.resource-key_length`' />
+ </set>
+ <for index='key-index' start='0' end='`$tmp.resource-resolution-data.resource-key_length`' >
+ <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="self-serve-create-vpe-pool: key-index"/>
+ <parameter name="field3" value='`$key-index`'/>
+ </record>
+ <block>
+ <switch test="`$tmp.resource-resolution-data.resource-key[$key-index].name == 'vpe_name'`">
+ <outcome value='true'>
+ <block>
+ <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="self-serve-create-vpe-pool: Found resource-resolution-data.name = vpe_name"/>
+ </record>
+ <set>
+ <parameter name='tmp.vpe_name' value='`$tmp.resource-resolution-data.resource-key[$key-index].value`' />
+ </set>
+ <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="self-serve-mac-address-assign: resolved vpe_name: "/>
+ <parameter name="field3" value='`$tmp.vpe_name`'/>
+ </record>
+ <break/>
+ </block>
+ </outcome>
+ <outcome value='false'></outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$tmp.vpe_name`">
+ <outcome value='null'>
+ <block>
+ <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="self-serve-mac-address-assign: hostname is not set"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='403' />
+ <parameter name='error-message' value='vpe_name is not valid' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block>
+ <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="self-serve-mac-address-assign: hostname is not set"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='403' />
+ <parameter name='error-message' value='vpe_name is not valid' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <block atomic='true'>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+key="select * FROM VPE_POOL WHERE vpe_name= $tmp.vpe_name" pfx='tmp.vpe_pool_data'>
+ <outcome value='failure'>
+ <block>
+ <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="self-serve-mac-address-assign: Unable to access VPE_POOL"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='405' />
+ <parameter name='error-message' value='Unable to access VPE_POOL' />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <switch test="`$tmp.vpe_pool_data.vpe-name`">
+ <outcome value=''>
+ <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="self-serve-mac-address-assign: data not found in VPE_POOL for vpe_name: "/>
+ <parameter name="field3" value='`$tmp.vpe_name`'/>
+ </record>
+ </outcome>
+ <outcome value='null'>
+ <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="self-serve-mac-address-assign: data not found in VPE_POOL for vpe_name: "/>
+ <parameter name="field3" value='`$tmp.vpe_name`'/>
+ </record>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <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="self-serve-mac-address-assign: data already found in VPE_POOL for vpe_name: "/>
+ <parameter name="field3" value='`$tmp.vpe_name`'/>
+ </record>
+ <switch test="`$ss.capability-action == 'ASSIGN'`">
+ <outcome value='true'>
+ <block>
+ <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="self-serve-mac-address-assign: Unable to create vpe-pool, data already exists in VPE_POOL for vpe_name"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='405' />
+ <parameter name='error-message' value='Unable to create vpe-pool, data already exists in VPE_POOL for vpe_name' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test='`$ss.capability-action`'>
+ <outcome value='ASSIGN'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.resource-key-length' value='`$tmp.resource-resolution-data.resource-key_length`' />
+ <!-- String to build VPE_POOL table SQL insert statement -->
+ <parameter name='tmp.resource-insert-columns' value='' />
+ <parameter name='tmp.resource-insert-values' value='' />
+ <!-- These are the resources to insert into VPE_POOL -->
+ <parameter name='tmp.resource-names-length' value='19' />
+ <parameter name='tmp.resource-names[0]' value='vpe_name' />
+ <parameter name='tmp.resource-names[1]' value='ipv4_oam_address' />
+ <parameter name='tmp.resource-names[2]' value='loopback0' />
+ <parameter name='tmp.resource-names[3]' value='provisioning_status' />
+ <parameter name='tmp.resource-names[4]' value='aic_site_id' />
+ <parameter name='tmp.resource-names[5]' value='avaiablity_zone' />
+ <parameter name='tmp.resource-names[6]' value='vlan_id_outer' />
+ <parameter name='tmp.resource-names[7]' value='vendor' />
+ <parameter name='tmp.resource-names[8]' value='physical_intf_name' />
+ <parameter name='tmp.resource-names[9]' value='phyiscal_intf_speed' />
+ <parameter name='tmp.resource-names[10]' value='phyiscal_intf_units' />
+ <parameter name='tmp.resource-names[11]' value='vpe_uuid' />
+ <parameter name='tmp.resource-names[12]' value='vpe_id' />
+ <parameter name='tmp.resource-names[13]' value='image_filename' />
+ <parameter name='tmp.resource-names[14]' value='as_number' />
+ <parameter name='tmp.resource-names[15]' value='loopback5000' />
+ <parameter name='tmp.resource-names[16]' value='loopback10' />
+ <parameter name='tmp.resource-names[17]' value='aic_version' />
+ <parameter name='tmp.resource-names[18]' value='vpe_capacity' />
+ </set>
+ <for index='names-index' start='0' end='`$tmp.resource-names-length`' >
+ <for index='key-index' start='0' end='`$tmp.resource-resolution-data.resource-key_length`' >
+ <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="self-serve-create-vpe-pool: key-index, resource-key.name, resource-names"/>
+ <parameter name="field3" value='`$key-index`'/>
+ <parameter name="field4" value='`$tmp.resource-resolution-data.resource-key[$key-index].name`'/>
+ <parameter name="field5" value='`$tmp.resource-names[$names-index]`'/>
+ </record>
+ <switch test="`$tmp.resource-resolution-data.resource-key[$key-index].name == $tmp.resource-names[$names-index]`">
+ <outcome value='true'>
+ <block>
+ <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="self-serve-create-vpe-pool: resource-name MATCH: "/>
+ <parameter name="field3" value='`$tmp.resource-names[$names-index]`'/>
+ <parameter name="field4" value='`$tmp.resource-resolution-data.resource-key[$key-index].value`'/>
+ </record>
+ <switch test="`$tmp.insert-columns`">
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.insert-columns' value="`$tmp.resource-resolution-data.resource-key[$key-index].name`" />
+ <parameter name='tmp.insert-values' value="$tmp.resource-resolution-data.resource-key[$key-index].value`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.insert-columns' value="`$tmp.insert-columns + ', ' + $tmp.resource-resolution-data.resource-key[$key-index].name`" />
+ <parameter name='tmp.insert-values' value="`$tmp.insert-values + ', ' + $tmp.resource-resolution-data.resource-key[$key-index].value`" />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="`'tmp.forInsert.' + $tmp.resource-resolution-data.resource-key[$key-index].name`" value="`$tmp.resource-resolution-data.resource-key[$key-index].value`" />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource"
+resource="SQL"
+key="INSERT INTO VPE_POOL ( vpe_name, ipv4_oam_address, loopback0_ipv4_address, provisioning_status, aic_site_id, availability_zone, vlan_id_outer, vendor, physical_intf_name, physical_intf_speed, physical_intf_units, vpe_uuid, vpe_id, image_filename, as_number, loopback5000, loopback10, aic_version, vpe_capacity )
+VALUES ( $tmp.forInsert.vpe_name , $tmp.forInsert.ipv4_oam_address , $tmp.forInsert.loopback0_ipv4_address , $tmp.forInsert.provisioning_status , $tmp.forInsert.aic_site_id , $tmp.forInsert.availability_zone , $tmp.forInsert.vlan_id_outer , $tmp.forInsert.vendor , $tmp.forInsert.physical_intf_name , $tmp.forInsert.physical_intf_speed , $tmp.forInsert.physical_intf_units , $tmp.forInsert.vpe_uuid , $tmp.forInsert.vpe_id , $tmp.forInsert.image_filename , $tmp.forInsert.as_number , $tmp.forInsert.loopback5000 , $tmp.forInsert.loopback10 , $tmp.forInsert.aic_version , $tmp.forInsert.vpe_capacity )"
+force='true' pfx='save_val'>
+ <outcome value='failure'>
+ <block>
+ <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="self-serve-mac-address-assign: Unable to create VPE Pool in VPE_POOL"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='406' />
+ <parameter name='error-message' value='Unable to create VPE Pool in VPE_POOL' />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='UNASSIGN'>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+key="select * FROM VPE_POOL WHERE vpe_name= $tmp.vpe_name" pfx='tmp.pool'>
+ <outcome value='failure'>
+ <block>
+ <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="self-serve-mac-address-assign: vpe_name not found in VPE_POOL on UNASSIGN operation"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='405' />
+ <parameter name='error-message' value='vpe_name not found in VPE_POOL on UNASSIGN operation' />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <switch test="`$tmp.pool.vpe-name`">
+ <outcome value='failure'>
+ <block>
+ <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="self-serve-mac-address-assign: vpe_name not found in VPE_POOL on UNASSIGN operation"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='405' />
+ <parameter name='error-message' value='vpe_name not found in VPE_POOL on UNASSIGN operation' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block>
+ <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="self-serve-mac-address-assign: vpe_name not found in VPE_POOL on UNASSIGN operation"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='405' />
+ <parameter name='error-message' value='vpe_name not found in VPE_POOL on UNASSIGN operation' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='null'>
+ <block>
+ <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="self-serve-mac-address-assign: vpe_name not found in VPE_POOL on UNASSIGN operation"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='405' />
+ <parameter name='error-message' value='vpe_name not found in VPE_POOL on UNASSIGN operation' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+key='DELETE from VPE_POOL WHERE vpe_name = $tmp.vpe_name'>
+ <outcome value='failure'>
+ <block>
+ <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="self-serve-mac-address-assign: Failure deleting from VPE_POOL on UNASSIGN operation"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='405' />
+ <parameter name='error-message' value='Failure deleting from VPE_POOL on UNASSIGN operation' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <for index='key-index' start='0' end='`$tmp.resource-resolution-data.resource-key_length`' >
+ <set>
+ <parameter name="`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-parameters-index].resource-resolution-data.status`" value="DELETED" />
+ </set>
+ </for>
+ </block>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/self-serve-create-vpe-pool.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-parameters-index].resource-resolution-data.status`" value='SUCCESS' />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-eipam-create-pool.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-eipam-create-pool.xml
new file mode 100644
index 00000000..15648b48
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-eipam-create-pool.xml
@@ -0,0 +1,157 @@
+<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='self-serve-eipam-create-pool' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='vnf-index' value='0' />
+ <parameter name='vf-module-index' value='0' />
+ <parameter name='ss.capability-name' value='self-serve-eipam-create-pool' />
+ <parameter name='ss.capability-action' value='assign' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.sdnc-generated-cloud-resources'
+ value='true' />
+ <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param_length' value = '1' />
+ <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].name' value = 'ipv4-wan-address-pool' />
+ <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].value' value = '${ipv4-wan-address-pool}' />
+ <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.capability-name' value = 'eipam-create-pool' />
+ <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[0].name' value = 'group-flag' />
+ <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[0].value' value = 'Y' />
+ <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[1].name' value = 'plan-name' />
+ <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[1].value' value = 'GMIS_V4_VPE_WAN' />
+ <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[2].name' value = 'service-instance-id' />
+ <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[2].value' value = '12345' />
+ <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[3].name' value = 'region' />
+ <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[3].value' value = 'mtn6' />
+ <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[4].name' value = 'address-family' />
+ <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[4].value' value = 'ipv4' />
+ <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[5].name' value = 'equipment' />
+ <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[5].value' value = 'VPE' />
+ <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[6].name' value = 'mask' />
+ <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[6].value' value = '32' />
+ <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[7].name' value = 'allocateSubnetFlag' />
+ <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[7].value' value = 'N' />
+ <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[8].name' value = 'service-instance-id' />
+ <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key[8].value' value = '111222' />
+ <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.resource-key_length' value = '9' />
+ <parameter name='service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameters.param[0].resource-resolution-data.status' value = 'PENDING' />
+ </set>
+ <switch test='`$ss.capability-name`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-name is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$ss.capability-action`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-action is null" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'Invalid capability-action: '+ ss.capability-action + 'only assign is supported'`" />
+ </return>
+ </outcome>
+ <outcome value='assign'>
+ <block atomic="true">
+ <block>
+ <for index="pidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`">
+ <set>
+ <parameter name='tmp.ss.param.capability-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$tmp.ss.param.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </for>
+ <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="`'SS: pidx: ' + $pidx`"/>
+ </record>
+ <for index="kidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key_length`">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].name`'>
+ <outcome value='group-flag'>
+ <set>
+ <parameter name='tmp.ss.group-flag' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='allocateSubnetFlag'>
+ <set>
+ <parameter name='tmp.ss.allocateSubnetFlag' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='plan-name'>
+ <set>
+ <parameter name='tmp.ss.plan-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='service-instance-id'>
+ <set>
+ <parameter name='tmp.ss.service-instance-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='address-family'>
+ <set>
+ <parameter name='tmp.ss.address-family' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='mask'>
+ <set>
+ <parameter name='tmp.ss.mask' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ <set>
+ <parameter name='aai.cloud-region.cloud-region-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.aic-cloud-region`' />
+ </set>
+ <set>
+ <parameter name='tmp.skip-first-level' value='Y' />
+ <parameter name='tmp.allocate-subnet-flag' value='`$tmp.ss.allocateSubnetFlag`' />
+ <parameter name='eipam-ip-block.group-flag' value='`$tmp.ss.group-flag`' />
+ </set>
+ <switch test='`$tmp.ss.address-family`'>
+ <outcome value='ipv4'>
+ <set>
+ <parameter name='network-model.eipam-v4-address-plan' value='tmp.ss.plan-name' />
+ <parameter name='network-model.use-ipv4' value='Y' />
+ <parameter name='network-model.ipv4-ip-version' value='tmp.ss.address-family' />
+ <parameter name='network-model.ipv4-cidr-mask' value='tmp.ss.mask' />
+ </set>
+ </outcome>
+ <outcome value='ipv6'>
+ <set>
+ <parameter name='network-model.eipam-v6-address-plan' value='tmp.ss.plan-name' />
+ <parameter name='network-model.use-ipv6' value='Y' />
+ <parameter name='network-model.ipv6-ip-version' value='tmp.ss.address-family' />
+ <parameter name='network-model.ipv6-cidr-mask' value='tmp.ss.mask' />
+ </set>
+ </outcome>
+ </switch>
+ <call module='GENERIC-RESOURCE-API' rpc='process-generic-eipam-pools' 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="`'Error from process-generic-eipam-pools, ' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-eipam-ip-assignment.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-eipam-ip-assignment.xml
new file mode 100644
index 00000000..7b813073
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-eipam-ip-assignment.xml
@@ -0,0 +1,269 @@
+<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='self-serve-eipam-ip-assignment' mode='sync'>
+ <block atomic="true">
+ <switch test='`$ss.capability-name`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-name is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$ss.capability-action`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-action is null" />
+ </return>
+ </outcome>
+ <outcome value='assign'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='self-service-capability-param-resolution' 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="`'Not all assignments are resolved' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <block>
+ <for index="pidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`">
+ <set>
+ <parameter name='tmp.ss.param.capability-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$tmp.ss.param.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </for>
+ <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="`'SS: pidx: ' + $pidx`"/>
+ </record>
+ <for index="kidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key_length`">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].name`'>
+ <outcome value='group-flag'>
+ <set>
+ <parameter name='tmp.ss.group-flag' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='plan-name'>
+ <set>
+ <parameter name='tmp.ss.plan-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='address-family'>
+ <set>
+ <parameter name='tmp.ss.address-family' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='client-key'>
+ <set>
+ <parameter name='tmp.ss.client-key' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-generate-FQPN' 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="`'Not all assignments are resolved' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='eipam-ip-block.plans[0].requests[0].'
+ value='self-serve-generate-FQPN-output.' />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.group-flag'
+ value='`$tmp.ss.group-flag`' />
+ <parameter name='eipam-ip-block.plans[0].plan-name'
+ value='`$tmp.ss.plan-name`' />
+ <parameter name='eipam-ip-block.plans[0].address-family'
+ value="`$tmp.ss.address-family`" />
+ <parameter name='eipam-ip-block.plans[0].requests[0].client-key'
+ value="`$tmp.ss.client-key`" />
+ </set>
+ <set>
+ <parameter name='eipam-ip-block.plans[0].requests_length' value='1' />
+ </set>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="assignIPAddress">
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <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 ip addresses from EIPAM: ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <for index="pidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].name`'>
+ <outcome value='vmxvre_oam_ip_0'>
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value'
+ value='`$eipam-ip-block.plans[0].requests[0].ip-prefix`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status'
+ value='SUCCESS' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='vmxvre_oam_ip_prefix_0'>
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value'
+ value='`$eipam-ip-block.plans[0].requests[0].ip-prefix-length`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status'
+ value='SUCCESS' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='vmxvre_oam_gateway'>
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value'
+ value='`$eipam-ip-block.plans[0].requests[0].ReservedAssignments[0].ReservedAssignment[3].ReservedKeyIPAddress`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status'
+ value='SUCCESS' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='unassign'>
+ <block atomic="true">
+ <block>
+ <for index="pidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`">
+ <set>
+ <parameter name='tmp.ss.param.capability-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$tmp.ss.param.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </for>
+ <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="`'SS: pidx: ' + $pidx`"/>
+ </record>
+ <for index="kidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key_length`">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].name`'>
+ <outcome value='group-flag'>
+ <set>
+ <parameter name='tmp.ss.group-flag' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='plan-name'>
+ <set>
+ <parameter name='tmp.ss.plan-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='address-family'>
+ <set>
+ <parameter name='tmp.ss.address-family' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='client-key'>
+ <set>
+ <parameter name='tmp.ss.client-key' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from EIPAM_IP_ASSIGNMENTS
+ WHERE service_instance_id = $tmp.ss.service-instance-id
+ AND client_key = $tmp.ss.client-key'>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.status' value="PENDING_DELETE" />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL"
+ key="UPDATE EIPAM_IP_ASSIGNMENTS set status = $tmp.status
+ WHERE service_instance_id = $tmp.ss.service-instance-id
+ AND client_key = $tmp.ss.client-key" >
+ <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 to unassign ip with client_key=' + $tmp.ss.client-key + ' and service_instance_id=' + $tmp.ss.service-instance-id`" />
+ </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 EIPAMPlugin.unassignIPAddress with client-key='+ $tmp.ss.client-key`" />
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </get-resource>
+ <for index="pidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].name`'>
+ <outcome value='vmxvre_oam_ip_0'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status'
+ value='DELETED' />
+ </set>
+ </outcome>
+ <outcome value='vmxvre_oam_ip_prefix_0'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status'
+ value='DELETED' />
+ </set>
+ </outcome>
+ <outcome value='vmxvre_oam_gateway'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status'
+ value='DELETED' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss.eipam.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-generate-FQPN.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-generate-FQPN.xml
new file mode 100644
index 00000000..989163f1
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-generate-FQPN.xml
@@ -0,0 +1,129 @@
+<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='self-serve-generate-FQPN' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='eipam-ip-block.plan-name' value='`$tmp.ss.plan-name`' />
+ </set>
+ <set>
+ <parameter name='self-serve-generate-FQPN-output.' value='' />
+ </set>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="getPlanTopology">
+ <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 getting Keyname and Keyvalue for address plan, '+ $eipam-ip-block.planName + ', from EIPAM'`" />
+ </return>
+ </outcome>
+ </execute>
+ <switch test='`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="eipam-ip-block.getPlanTopologyResponse.TopologyDetails is null" />
+ </return>
+ </outcome>
+ </switch>
+ <for index="resp-index" start="0" end="`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length`">
+ <switch test='`$eipam-ip-block.plan-name == $eipam-ip-block.getPlanTopologyResponse.PlanName`'>
+ <outcome value='false'>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="`'eipam response plan-name ['+ $eipam-ip-block.getPlanTopologyResponse.PlanName + ' is not the same as input '+$eipam-ip-block.planName`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='pool-index'
+ value='`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails[$resp-index].Level - 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.getPlanTopologyResponse.key-name'
+ value='`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails[$resp-index].KeyName`' />
+ </set>
+ <set>
+ <parameter name='tmp.getPlanTopologyResponse.key-value-format'
+ value='`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails[$resp-index].KeyValueFormat`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$tmp.getPlanTopologyResponse.key-value-format`" />
+ <parameter name="regex" value=":" />
+ <parameter name="ctx_memory_result_key" value="tmp.split.key-value-format" />
+ </execute>
+ <set>
+ <parameter name='tmp.final.key-value' value="" />
+ </set>
+ <for index="split-index" start="0" end="`$tmp.split.key-value-format_length`">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.split.key-value-format[$split-index]`" />
+ <parameter name="target" value="${"/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="tmp.split-value"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.split-value`" />
+ <parameter name="target" value="}"/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="tmp.ss.split-value"/>
+ </execute>
+ <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="`'SS: tmp.ss.split-value: ' + $tmp.ss.split-value`"/>
+ </record>
+ <for index="pidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`">
+ <set>
+ <parameter name='tmp.ss.param.capability-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$tmp.ss.param.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <for index="kidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$ss.param-index].resource-resolution-data.resource-key_length`">
+ <set>
+ <parameter name='tmp.ss.resource-key.name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].name`' />
+ </set>
+ <switch test='`$tmp.ss.split-value == $tmp.ss.resource-key.name`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.ss.partial.key-value'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$split-index == 0`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.ss.final.key-value' value="`$tmp.ss.partial.key-value`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.ss.final.key-value'
+ value="`$tmp.ss.final.key-value + ':' + $tmp.ss.partial.key-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='self-serve-generate-FQPN-output.pools[$pool-index].key-name'
+ value='`$tmp.getPlanTopologyResponse.key-name`' />
+ <parameter name='self-serve-generate-FQPN-output.pools[$pool-index].key-value'
+ value='`$tmp.ss.final.key-value`' />
+ </set>
+ </for>
+ <set>
+ <parameter name='self-serve-generate-FQPN-output.pools_length'
+ value='`$eipam-ip-block.getPlanTopologyResponse.TopologyDetails_length`' />
+ </set>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-generate-name.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-generate-name.xml
new file mode 100644
index 00000000..b5538fbd
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-generate-name.xml
@@ -0,0 +1,453 @@
+<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='self-serve-generate-name' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.naming-data-payload' value='{&quot;elements&quot;:[' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-capability-param-resolution' 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="Error from capability-param-resolution" />
+ </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="Error from capability-param-resolution" />
+ </return>
+ </outcome>
+ </call>
+ <switch test="`$ss.capability-type == 'vnf'`">
+ <outcome value='true'>
+ <for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <block>
+ <switch test="`$ss.capability-action == 'unassign'`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '{'`" />
+ </set>
+ <for index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key_length`' >
+ <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name == 'external-key'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="tmp.naming-data-payload" value="`$tmp.naming-data-payload + '&quot;' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name + '&quot;:' + '&quot;' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value + '&quot;,'`"/>
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '},'`" />
+ </set>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + ']}'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',}' />
+ <parameter name='replacement' value='}' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',]' />
+ <parameter name='replacement' value=']' />
+ </execute>
+ <execute plugin='org.openecomp.sdnc.prov.namegeneration.node.UnAssignNameNode' method='process'>
+ <parameter name='payload' value='`$tmp.naming-data-payload`' />
+ <parameter name="prifix" value="nameGenResponse" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Unassign" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Unassign" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="nameGenResponse.response-payload" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="false" />
+ </execute>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.status`' value='DELETED' />
+ </set>
+ <for index='n' start='0' end='`$jsonContextPrefix.elements_length`' >
+ <for index='l' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$l].value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='true'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='resource-resolution-split' />
+ <parameter name='original_string' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$l].value`' />
+ <parameter name='regex' value='\$\{' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='s2' />
+ <parameter name='original_string' value='`$resource-resolution-split[1]`' />
+ <parameter name='regex' value='\}' />
+ </execute>
+ <switch test='`$s2[0] == $jsonContextPrefix.elements[$n].resource-name`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$l].value`' value="`$jsonContextPrefix.elements[$n].resource-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </execute>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$ss.capability-action == 'assign'`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '{'`" />
+ </set>
+ <for index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key_length`' >
+ <set>
+ <parameter name="tmp.naming-data-payload" value="`$tmp.naming-data-payload + '&quot;' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].name + '&quot;:' + '&quot;' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.resource-key[$j].value + '&quot;,'`"/>
+ </set>
+ </for>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '},'`" />
+ </set>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + ']}'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',}' />
+ <parameter name='replacement' value='}' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',]' />
+ <parameter name='replacement' value=']' />
+ </execute>
+ <execute plugin='org.openecomp.sdnc.prov.namegeneration.node.AssignNameNode' method='process'>
+ <parameter name='payload' value='`$tmp.naming-data-payload`' />
+ <parameter name="prifix" value="nameGenResponse" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Assign" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Assign" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="nameGenResponse.response-payload" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="false" />
+ </execute>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].resource-resolution-data.status`' value='SUCCESS' />
+ </set>
+ <for index='n' start='0' end='`$jsonContextPrefix.elements_length`' >
+ <for index='l' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$l].value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='true'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='resource-resolution-split' />
+ <parameter name='original_string' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$l].value`' />
+ <parameter name='regex' value='\$\{' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='s2' />
+ <parameter name='original_string' value='`$resource-resolution-split[1]`' />
+ <parameter name='regex' value='\}' />
+ </execute>
+ <switch test='`$s2[0] == $jsonContextPrefix.elements[$n].resource-name`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$l].value`' value="`$jsonContextPrefix.elements[$n].resource-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </execute>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test="`$ss.capability-type == 'vf-module'`">
+ <outcome value='true'>
+ <for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <block>
+ <switch test="`$ss.capability-action == 'unassign'`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '{'`" />
+ </set>
+ <for index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key_length`' >
+ <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].name == 'external-key'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="tmp.naming-data-payload" value="`$tmp.naming-data-payload + '&quot;' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].name + '&quot;:' + '&quot;' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value + '&quot;,'`"/>
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '},'`" />
+ </set>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + ']}'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',}' />
+ <parameter name='replacement' value='}' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',]' />
+ <parameter name='replacement' value=']' />
+ </execute>
+ <execute plugin='org.openecomp.sdnc.prov.namegeneration.node.UnAssignNameNode' method='process'>
+ <parameter name='payload' value='`$tmp.naming-data-payload`' />
+ <parameter name="prifix" value="nameGenResponse" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Unassign" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Unassign" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="nameGenResponse.response-payload" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="false" />
+ </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.vf-module-parameters.param[$i].resource-resolution-data.status`' value='DELETED' />
+ </set>
+ <for index='n' start='0' end='`$jsonContextPrefix.elements_length`' >
+ <for index='l' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$l].value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='true'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='resource-resolution-split' />
+ <parameter name='original_string' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$l].value`' />
+ <parameter name='regex' value='\$\{' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='s2' />
+ <parameter name='original_string' value='`$resource-resolution-split[1]`' />
+ <parameter name='regex' value='\}' />
+ </execute>
+ <switch test='`$s2[0] == $jsonContextPrefix.elements[$n].resource-name`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$l].value`' value="`$jsonContextPrefix.elements[$n].resource-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </execute>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$ss.capability-action == 'assign'`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '{'`" />
+ </set>
+ <for index='j' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key_length`' >
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="`'AJJJ13' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].name`" />
+ <parameter name="field2" value="`'AJJJ14' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value`" />
+ </record>
+ <set>
+ <parameter name="tmp.naming-data-payload" value="`$tmp.naming-data-payload + '&quot;' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].name + '&quot;:' + '&quot;' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$j].value + '&quot;,'`"/>
+ </set>
+ </for>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + '},'`" />
+ </set>
+ <set>
+ <parameter name='tmp.naming-data-payload' value="`$tmp.naming-data-payload + ']}'`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',}' />
+ <parameter name='replacement' value='}' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace'>
+ <parameter name='outputPath' value='tmp.naming-data-payload' />
+ <parameter name='source' value='`$tmp.naming-data-payload`' />
+ <parameter name='target' value=',]' />
+ <parameter name='replacement' value=']' />
+ </execute>
+ <execute plugin='org.openecomp.sdnc.prov.namegeneration.node.AssignNameNode' method='process'>
+ <parameter name='payload' value='`$tmp.naming-data-payload`' />
+ <parameter name="prifix" value="nameGenResponse" />
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Assign" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.status`' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from NameGenerationNode Assign" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="nameGenResponse.response-payload" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="false" />
+ </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.vf-module-parameters.param[$i].resource-resolution-data.status`' value='SUCCESS' />
+ </set>
+ <for index='n' start='0' end='`$jsonContextPrefix.elements_length`' >
+ <for index='l' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$l].value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='true'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='resource-resolution-split' />
+ <parameter name='original_string' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$l].value`' />
+ <parameter name='regex' value='\$\{' />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='s2' />
+ <parameter name='original_string' value='`$resource-resolution-split[1]`' />
+ <parameter name='regex' value='\}' />
+ </execute>
+ <switch test='`$s2[0] == $jsonContextPrefix.elements[$n].resource-name`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$l].value`' value="`$jsonContextPrefix.elements[$n].resource-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </execute>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-mac-address-assign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-mac-address-assign.xml
new file mode 100755
index 00000000..0d56b233
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-mac-address-assign.xml
@@ -0,0 +1,615 @@
+<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='self-serve-mac-address-assign' mode='sync'>
+ <block atomic='true'>
+ <switch test="`$ss.capability-name`">
+ <outcome value='Other'>
+ <block>
+ <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="self-serve-mac-address-assign: ss.capability-name is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='401' />
+ <parameter name='error-message' value='ss.capability-name is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block>
+ <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="self-serve-mac-address-assign: ss.capability-name is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='401' />
+ <parameter name='error-message' value='ss.capability-name is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='null'>
+ <block>
+ <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="self-serve-mac-address-assign: ss.capability-name is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='401' />
+ <parameter name='error-message' value='ss.capability-name is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='mac-address-assign'>
+ <record plugin="com.att.sdnctl.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="self-serve-mac-address-assign: ss.capability-name is mac-address-assign"/>
+ </record>
+ </outcome>
+ </switch>
+ <switch test="`$ss.capability-action`">
+ <outcome value='Other'></outcome>
+ <outcome value=''>
+ <block>
+ <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="self-serve-mac-address-assign: ss.capability-action is not set"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='401' />
+ <parameter name='error-message' value='ss.capability-action is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='null'></outcome>
+ <outcome value='ASSIGN'>
+ <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="self-serve-mac-address-assign: ss.capability-action is ASSIGN"/>
+ </record>
+ </outcome>
+ <outcome value='UNASSIGN'>
+ <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="self-serve-mac-address-assign: ss.capability-action is UNASSIGN"/>
+ </record>
+ </outcome>
+ </switch>
+ <block atomic='true'>
+ <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="self-serve-mac-address-assign: call self-service-capability-param-resolution DG"/>
+ </record>
+ <set>
+ <!--<parameter name='generate-unique-name-input.index-table-name' value='VM_NAME_INDEX' />-->
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-capability-param-resolution' mode='sync' >
+ <outcome value='failure'>
+ <block>
+ <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="self-serve-mac-address-assign: Failure calling self-service-capability-param-resolution"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='402' />
+ <parameter name='error-message' value='Failure calling self-service-capability-param-resolution' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'></outcome>
+ </call>
+ </block>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.vf-module-parameters-length' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' />
+ </set>
+ <for index='vf-module-param-index' start='0' end='`$tmp.vf-module-parameters-length`' >
+ <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="self-serve-mac-address-assign: vf-module-param-index"/>
+ <parameter name="field3" value='`$vf-module-param-index`'/>
+ </record>
+ <block>
+ <set>
+ <parameter name='vfModuleParamsCapabilityName' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test="`$ss.capability-name == $vfModuleParamsCapabilityName`">
+ <outcome value='true'>
+ <block>
+ <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="self-serve-mac-address-assign: Found ss.capability-name MATCH"/>
+ </record>
+ <set>
+ <parameter name='tmp.resource-resolution-data.' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ <outcome value='false'></outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ <switch test="`$tmp.resource-resolution-data.status == 'PENDING'`">
+ <outcome value='false'>
+ <block>
+ <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="self-serve-mac-address-assign: reseouce-resolution-data.status is not PENDING"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='401' />
+ <parameter name='error-message' value='reseouce-resolution-data.status is not PENDING' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.resource-key-length' value='`$tmp.resource-resolution-data.resource-key_length`' />
+ </set>
+ <for index='key-index' start='0' end='`$tmp.resource-resolution-data.resource-key_length`' >
+ <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="self-serve-mac-address-assign: key-index"/>
+ <parameter name="field3" value='`$key-index`'/>
+ </record>
+ <block>
+ <switch test="`$tmp.resource-resolution-data.resource-key[$key-index].name == 'vnf-name'`">
+ <outcome value='true'>
+ <block>
+ <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="self-serve-mac-address-assign: Found resource-resolution-data.name = vnf-name"/>
+ </record>
+ <set>
+ <parameter name='tmp.hostname' value='`$tmp.resource-resolution-data.resource-key[$key-index].value`' />
+ </set>
+ <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="self-serve-mac-address-assign: resolved hostname: "/>
+ <parameter name="field3" value='`$tmp.hostname`'/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='false'></outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$tmp.hostname`">
+ <outcome value='null'>
+ <block>
+ <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="self-serve-mac-address-assign: hostname is not set"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='403' />
+ <parameter name='error-message' value='hostname is not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block>
+ <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="self-serve-mac-address-assign: hostname is not set"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='403' />
+ <parameter name='error-message' value='hostname is not set' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ <switch test='`$ss.capability-action`'>
+ <outcome value='ASSIGN'>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+key="select * FROM VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING WHERE HOSTNAME= $tmp.hostname" pfx='tmp.map'>
+ <outcome value='failure'>
+ <block>
+ <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="self-serve-mac-address-assign: Unable to access VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='405' />
+ <parameter name='error-message' value='Unable to access VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING' />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <switch test="`$tmp.map.hostname`">
+ <outcome value='failure'>
+ <block>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+key="SELECT MIN(pool.id) as pool_id, pool.mac_address FROM VPE_MAC_ADDRESS_POOL pool WHERE NOT EXISTS(SELECT ID FROM VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING map where pool.ID = map.ID)" pfx='tmp.availid'>
+ <!--
+tmp.availid.mac_address is the mac_address we need to have finally.
+-->
+ <outcome value='failure'>
+ <block>
+ <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="self-serve-mac-address-assign: reseouce-resolution-data.status is not PENDING"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='406' />
+ <parameter name='error-message' value='Failed to insert into VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING' />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource"
+resource="SQL"
+key="INSERT INTO VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING ( id , hostname , assigned_user, assigned_date ) VALUES ( $tmp.availid.pool-id , $tmp.hostname , 'SDNC' , NOW())"
+force='true' pfx='save_val'>
+ <outcome value='failure'>
+ <block>
+ <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="self-serve-mac-address-assign: reseouce-resolution-data.status is not PENDING"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='406' />
+ <parameter name='error-message' value='Failed to insert into VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING' />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name="tmp.mac-address.mac-address" value="`$tmp.availid.mac-address`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+key="SELECT MIN(pool.id) as pool_id, pool.mac_address FROM VPE_MAC_ADDRESS_POOL pool WHERE NOT EXISTS(SELECT ID FROM VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING map where pool.ID = map.ID)" pfx='tmp.availid'>
+ <!--
+tmp.availid.mac_address is the mac_address we need to have finally.
+-->
+ <outcome value='failure'>
+ <block>
+ <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="self-serve-mac-address-assign: reseouce-resolution-data.status is not PENDING"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='406' />
+ <parameter name='error-message' value='Failed to insert into VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING' />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource"
+resource="SQL"
+key="INSERT INTO VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING ( id , hostname , assigned_user, assigned_date ) VALUES ( $tmp.availid.pool-id , $tmp.hostname , 'SDNC' , NOW())"
+force='true' pfx='save_val'>
+ <outcome value='failure'>
+ <block>
+ <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="self-serve-mac-address-assign: reseouce-resolution-data.status is not PENDING"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='406' />
+ <parameter name='error-message' value='Failed to insert into VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING' />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name="tmp.mac-address.mac-address" value="`$tmp.availid.mac-address`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='null'>
+ <block>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+key="SELECT MIN(pool.id) as pool_id, pool.mac_address FROM VPE_MAC_ADDRESS_POOL pool WHERE NOT EXISTS(SELECT ID FROM VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING map where pool.ID = map.ID)" pfx='tmp.availid'>
+ <!--
+tmp.availid.mac_address is the mac_address we need to have finally.
+-->
+ <outcome value='failure'>
+ <block>
+ <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="self-serve-mac-address-assign: reseouce-resolution-data.status is not PENDING"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='406' />
+ <parameter name='error-message' value='Failed to insert into VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING' />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource"
+resource="SQL"
+key="INSERT INTO VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING ( id , hostname , assigned_user, assigned_date ) VALUES ( $tmp.availid.pool-id , $tmp.hostname , 'SDNC' , NOW())"
+force='true' pfx='save_val'>
+ <outcome value='failure'>
+ <block>
+ <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="self-serve-mac-address-assign: reseouce-resolution-data.status is not PENDING"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='406' />
+ <parameter name='error-message' value='Failed to insert into VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING' />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name="tmp.mac-address.mac-address" value="`$tmp.availid.mac-address`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+key="SELECT pool.mac_address FROM VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING map, VPE_MAC_ADDRESS_POOL pool WHERE pool.ID = map.ID AND map.HOSTNAME = $tmp.hostname" pfx="tmp.mac-address">
+ <outcome value='failure'>
+ <block>
+ <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="self-serve-mac-address-assign: reseouce-resolution-data.status is not PENDING"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='406' />
+ <parameter name='error-message' value='Failed to insert into VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING' />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.mac-address.mac-address`">
+ <outcome value=''>
+ <block>
+ <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="self-serve-mac-address-assign: tmp.mac_address not set"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='405' />
+ <parameter name='error-message' value='tmp.mac_address not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='null'>
+ <block>
+ <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="self-serve-mac-address-assign: tmp.mac_address not set"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='405' />
+ <parameter name='error-message' value='tmp.mac_address not set' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for index='vf-module-param-index' start='0' end='`$tmp.vf-module-parameters-length`' >
+ <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="self-serve-mac-address-assign: vf-module-param-index"/>
+ <parameter name="field3" value='`$vf-module-param-index`'/>
+ </record>
+ <block>
+ <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].name`">
+ <outcome value='vmxvpfe_sriov41_0_port_mac'>
+ <set>
+ <parameter name="`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].value`" value="`$tmp.mac-address.mac-address`" />
+ </set>
+ </outcome>
+ <outcome value='vmxvpfe_sriov41_1_port_mac'>
+ <set>
+ <parameter name="`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].value`" value="`$tmp.mac-address.mac-address`" />
+ </set>
+ </outcome>
+ <outcome value='vmxvpfe_sriov41_3_port_mac'>
+ <set>
+ <parameter name="`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].value`" value="`$tmp.mac-address.mac-address`" />
+ </set>
+ </outcome>
+ <outcome value='vmxvpfe_sriov41_4_port_mac'>
+ <set>
+ <parameter name="`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].value`" value="`$tmp.mac-address.mac-address`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </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.vf-module-parameters.param[$vf-module-parameters-index].resource-resolution-data.status`" value='SUCCESS' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='UNASSIGN'>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+key="select * FROM VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING WHERE HOSTNAME= $tmp.hostname" pfx='tmp.map'>
+ <outcome value='failure'>
+ <block>
+ <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="self-serve-mac-address-assign: Hostname not found in VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING on UNASSIGN operation"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='405' />
+ <parameter name='error-message' value='Hostname not found in VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING on UNASSIGN operation' />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <switch test="`$tmp.map.hostname`">
+ <outcome value='failure'>
+ <block>
+ <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="self-serve-mac-address-assign: Hostname not found in VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING on UNASSIGN operation"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='405' />
+ <parameter name='error-message' value='Hostname not found in VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING on UNASSIGN operation' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block>
+ <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="self-serve-mac-address-assign: Hostname not found in VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING on UNASSIGN operation"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='405' />
+ <parameter name='error-message' value='Hostname not found in VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING on UNASSIGN operation' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='null'>
+ <block>
+ <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="self-serve-mac-address-assign: Hostname not found in VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING on UNASSIGN operation"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='405' />
+ <parameter name='error-message' value='Hostname not found in VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING on UNASSIGN operation' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+key='DELETE from VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING WHERE hostname = $tmp.hostname'>
+ <outcome value='failure'>
+ <block>
+ <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="self-serve-mac-address-assign: Failure deleting from VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING on UNASSIGN operation"/>
+ </record>
+ <set>
+ <parameter name='$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-param-index].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='405' />
+ <parameter name='error-message' value='Failure deleting from VPE_MAC_ADDRESS_TO_HOSTNAME_MAPPING on UNASSIGN operation' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <for index='key-index' start='0' end='`$tmp.resource-resolution-data.resource-key_length`' >
+ <set>
+ <parameter name="`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-parameters-index].resource-resolution-data.status`" value="DELETED" />
+ </set>
+ </for>
+ </block>
+ </outcome>
+ </delete>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/self-serv-mac-address-assign.log' />
+ </execute>
+ <return status='success'>
+ <parameter name="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$vf-module-parameters-index].resource-resolution-data.status`" value='SUCCESS' />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-unresolved-composite-data.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-unresolved-composite-data.xml
new file mode 100644
index 00000000..58bb677f
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-unresolved-composite-data.xml
@@ -0,0 +1,440 @@
+<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='self-serve-unresolved-composite-data' mode='sync'>
+ <block atomic="true">
+ <switch test='`$ss.capability-name`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-name is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$ss.capability-action`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-action is null" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$ss.capability-type`'>
+ <outcome value=''>
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="ss.capability-type is null" />
+ </return>
+ </outcome>
+ <outcome value='vnf'>
+ <for index="pidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`">
+ <set>
+ <parameter name='tmp.ss.param.capability-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$tmp.ss.param.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.ss.composite'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].value`' />
+ </set>
+ <switch test="`$tmp.ss.composite == ''`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value' value="" />
+ <parameter name='tmp.ss.final.resolved-value.end' value="" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='startsWith' emitsOutcome='true' >
+ <parameter name="source" value="`$tmp.ss.composite`" />
+ <parameter name="target" value="["/>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value' value="[" />
+ <parameter name='tmp.ss.final.resolved-value.end' value="]" />
+ </set>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss.composite`" />
+ <parameter name="target" value="["/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="tmp.ss.composite-0"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss.composite-0`" />
+ <parameter name="target" value="]"/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="tmp.ss.composite-1"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$tmp.ss.composite-1`" />
+ <parameter name="outputPath" value="tmp.ss.composite-2"/>
+ </execute>
+ <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="`'SS: tmp.ss.composite-2: ' + $tmp.ss.composite-2`"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$tmp.ss.composite-2`" />
+ <parameter name="regex" value=","/>
+ <parameter name="ctx_memory_result_key" value="splits" />
+ </execute>
+ <for index="split-index" start="0" end="`$splits_length`">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$splits[$split-index]`" />
+ <parameter name="outputPath" value="tmp.ss.trim"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss.trim`" />
+ <parameter name="target" value="${"/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="tmp.ss.trim-0"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss.trim-0`" />
+ <parameter name="target" value="}"/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="tmp.ss.trim-1"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$tmp.ss.trim-1`" />
+ <parameter name="outputPath" value="tmp.ss.partial.composite-value"/>
+ </execute>
+ <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="`'SS: tmp.ss.partial.composite-value: ' + $tmp.ss.partial.composite-value`"/>
+ </record>
+ <switch test='`$ss.capability-type`'>
+ <outcome value='vnf'>
+ <for index="i" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`">
+ <set>
+ <parameter name='tmp.ss.param-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].name`' />
+ </set>
+ <switch test='`$tmp.ss.partial.composite-value == $tmp.ss.param-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.ss.partial.resolved-value'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].value`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='vf-module'>
+ <for index="i" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`">
+ <set>
+ <parameter name='tmp.ss.param-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].name`' />
+ </set>
+ <switch test='`$tmp.ss.partial.composite-value == $tmp.ss.param-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.ss.partial.resolved-value'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].value`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$split-index == 0`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value'
+ value="`$tmp.ss.final.resolved-value + $tmp.ss.partial.resolved-value`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value'
+ value="`$tmp.ss.final.resolved-value + ',' + $tmp.ss.partial.resolved-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value'
+ value='`$tmp.ss.final.resolved-value + $tmp.ss.final.resolved-value.end`' />
+ </set>
+ <switch test='`$ss.capability-type`'>
+ <outcome value='vnf'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$tmp.ss.final.resolved-value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].name + ' was not resolved by ' + $ss.capability + ' with value = '+ $tmp.ss.final.resolved-value`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].value'
+ value='`$tmp.ss.final.resolved-value`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status'
+ value='SUCCESS' />
+ </set>
+ </outcome>
+ </execute>
+ </outcome>
+ <outcome value='vf-module'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$tmp.ss.final.resolved-value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].name + ' was not resolved by ' + $ss.capability + ' with value = '+ $tmp.ss.final.resolved-value`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value'
+ value='`$tmp.ss.final.resolved-value`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status'
+ value='SUCCESS' />
+ </set>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='vf-module'>
+ <for index="pidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`">
+ <set>
+ <parameter name='tmp.ss.param.capability-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$tmp.ss.param.capability-name == $ss.capability-name`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.ss.composite'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value`' />
+ </set>
+ <switch test="`$tmp.ss.composite == ''`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value' value="" />
+ <parameter name='tmp.ss.final.resolved-value.end' value="" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='startsWith' emitsOutcome='true' >
+ <parameter name="source" value="`$tmp.ss.composite`" />
+ <parameter name="target" value="["/>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value' value="[" />
+ <parameter name='tmp.ss.final.resolved-value.end' value="]" />
+ </set>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss.composite`" />
+ <parameter name="target" value="["/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="tmp.ss.composite-0"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss.composite-0`" />
+ <parameter name="target" value="]"/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="tmp.ss.composite-1"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$tmp.ss.composite-1`" />
+ <parameter name="outputPath" value="tmp.ss.composite-2"/>
+ </execute>
+ <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="`'SS: tmp.ss.composite-2: ' + $tmp.ss.composite-2`"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value="`$tmp.ss.composite-2`" />
+ <parameter name="regex" value=","/>
+ <parameter name="ctx_memory_result_key" value="splits" />
+ </execute>
+ <for index="split-index" start="0" end="`$splits_length`">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$splits[$split-index]`" />
+ <parameter name="outputPath" value="tmp.ss.trim"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss.trim`" />
+ <parameter name="target" value="${"/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="tmp.ss.trim-0"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss.trim-0`" />
+ <parameter name="target" value="}"/>
+ <parameter name="replacement" value=""/>
+ <parameter name="outputPath" value="tmp.ss.trim-1"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='trim' >
+ <parameter name="source" value="`$tmp.ss.trim-1`" />
+ <parameter name="outputPath" value="tmp.ss.partial.composite-value"/>
+ </execute>
+ <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="`'SS: tmp.ss.partial.composite-value: ' + $tmp.ss.partial.composite-value`"/>
+ </record>
+ <switch test='`$ss.capability-type`'>
+ <outcome value='vnf'>
+ <for index="i" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`">
+ <set>
+ <parameter name='tmp.ss.param-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].name`' />
+ </set>
+ <switch test='`$tmp.ss.partial.composite-value == $tmp.ss.param-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.ss.partial.resolved-value'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].value`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='vf-module'>
+ <for index="i" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`">
+ <set>
+ <parameter name='tmp.ss.param-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].name`' />
+ </set>
+ <switch test='`$tmp.ss.partial.composite-value == $tmp.ss.param-name`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.ss.partial.resolved-value'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].value`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$split-index == 0`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value'
+ value="`$tmp.ss.final.resolved-value + $tmp.ss.partial.resolved-value`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value'
+ value="`$tmp.ss.final.resolved-value + ',' + $tmp.ss.partial.resolved-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='tmp.ss.final.resolved-value'
+ value='`$tmp.ss.final.resolved-value + $tmp.ss.final.resolved-value.end`' />
+ </set>
+ <switch test='`$ss.capability-type`'>
+ <outcome value='vnf'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$tmp.ss.final.resolved-value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].name + ' was not resolved by ' + $ss.capability + ' with value = '+ $tmp.ss.final.resolved-value`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].value'
+ value='`$tmp.ss.final.resolved-value`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status'
+ value='SUCCESS' />
+ </set>
+ </outcome>
+ </execute>
+ </outcome>
+ <outcome value='vf-module'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='contains' emitsOutcome='true' >
+ <parameter name="source" value="`$tmp.ss.final.resolved-value`" />
+ <parameter name="target" value="$"/>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].name + ' was not resolved by ' + $ss.capability + ' with value = '+ $tmp.ss.final.resolved-value`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value'
+ value='`$tmp.ss.final.resolved-value`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status'
+ value='SUCCESS' />
+ </set>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-composite.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vf-module-assign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vf-module-assign.xml
new file mode 100644
index 00000000..6abe8274
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vf-module-assign.xml
@@ -0,0 +1,551 @@
+<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='self-serve-vf-module-assign' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='is-new-vfmodule' value='true' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='vf-module-index' value='0' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length' value='`$vf-module-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='vf-module-index' value='0' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length' value='`$vf-module-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <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'>
+ <block>
+ <set>
+ <parameter name='is-new-vfmodule' value='false' />
+ </set>
+ <set>
+ <parameter name='vf-module-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$is-new-vfmodule`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vf-module-index' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$is-new-vfmodule`'>
+ <outcome value='true'>
+ <block>
+ <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='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'
+ value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='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-name'
+ value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-name`' />
+ <parameter name='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-type'
+ value='`$vf-module-topology-operation-input.vf-module-information.vf-module-type`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.tenant'
+ value='`$vf-module-topology-operation-input.vf-module-request-input.tenant`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.aic-cloud-region'
+ value='`$vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region`' />
+ <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='`$vf-module-topology-operation-input.vf-module-request-input.aic-clli`' />
+ </set>
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.onap-model-information.model-invariant-uuid'
+ value='`$db.vf-module-model.invariant-uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.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='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.onap-model-information.model-uuid'
+ value='`$db.vf-module-model.uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.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='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.onap-model-information.model-version'
+ value='`$db.vf-module-model.version`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.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='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.onap-model-information.model-name'
+ value='`$db.vf-module-model.name`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.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='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.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='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>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.sdnc-generated-cloud-resources'
+ value='true' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='ss.capability-type' value='vf-module' />
+ </set>
+ <set>
+ <parameter name='ss.capability.execution-order[0]' value='generate-name' />
+ <parameter name='ss.capability.execution-order[1]' value='alts-entitlement-assign' />
+ <parameter name='ss.capability.execution-order[2]' value='alts-license-assign' />
+ <parameter name='ss.capability.execution-order[3]' value='vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[4]' value='eipam-ip-assign' />
+ <parameter name='ss.capability.execution-order[5]' value='eipam-create-pool"' />
+ <parameter name='ss.capability.execution-order[6]' value='mac-address-assign' />
+ <parameter name='ss.capability.execution-order[7]' value='create-vpe-pool' />
+ <parameter name='ss.capability.execution-order[8]' value='unresolved-composite-data' />
+ <parameter name='ss.capability.execution-order_length' value='9' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.'
+ value='vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vfmodule-ra-assignment' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to get RA assignments: ' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ <for index='cidx' start='0' end='`$ss.capability.execution-order_length`' >
+ <set>
+ <parameter name='ss.capability-name' value='`$ss.capability.execution-order[$cidx]`' />
+ <!--
+ss.capability.execution-order
+-->
+ </set>
+ <set>
+ <parameter name='ss.capability-action' value='assign' />
+ </set>
+ <switch test='`$ss.capability-name`'>
+ <outcome value='alts-entitlement-assign'>
+ <set>
+ <parameter name='ss.capability-dg' value='self-serve-alts-assignment' />
+ </set>
+ </outcome>
+ <outcome value='alts-license-assign'>
+ <set>
+ <parameter name='ss.capability-dg' value='self-serve-alts-assignment' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='ss.capability-dg' value="`'self-serve-' + $ss.capability.execution-order[$cidx]`" />
+ </set>
+ </outcome>
+ </switch>
+ <for index='pidx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <set>
+ <parameter name='tmp.param.capability-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$ss.capability-name == $tmp.param.capability-name`'>
+ <outcome value='true'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status`'>
+ <outcome value='SUCCESS'>
+ <set>
+ <parameter name='`$ss.capability-dg`' value='ASSIGNED' />
+ </set>
+ </outcome>
+ <outcome value='PENDING'>
+ <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
+ <outcome value='success'>
+ <set>
+ <parameter name='`$ss.capability-dg`' value='ASSIGNED' />
+ </set>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='vf.vf-module-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`' />
+ <parameter name='vf.vf-module-data.sdnc-request-header.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.sdnc-request-header.`' />
+ <parameter name='vf.vf-module-data.request-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.request-information.`' />
+ <parameter name='vf.vf-module-data.service-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.`' />
+ <parameter name='vf.vf-module-data.vnf-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.`' />
+ <parameter name='vf.vf-module-data.vf-module-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.`' />
+ <parameter name='vf.vf-module-data.vf-module-topology.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.`' />
+ <parameter name='vf.vf-module-data.vf-module-level-oper-status.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.vf-module-input-parameters.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.vf-module-input-parameters.`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.request-version'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.request-version`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.vf-module-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.vf-module-name`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.tenant'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.tenant`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.aic-cloud-region'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.aic-cloud-region`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.aic-clli'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.aic-clli`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-vfmodule-assignments`"/>
+ <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-vfmodule-url`"/>
+ <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.vnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-vfmodule-url`"/>
+ <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
+ <parameter name="target" value="{vf-module-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.vfmodule.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ss-vfmodule-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ss-vfmodule" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed to persist self-serve vf-module assignments during assign in MD-SAL" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed to persist self-serve vf-module assignments during assign in MD-SAL" />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error from capability: '+ $ss.capability-dg + ', with error: '+ $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='FAILED'>
+ <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
+ <outcome value='success'>
+ <set>
+ <parameter name='`$ss.capability-dg`' value='ASSIGNED' />
+ </set>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='vf.vf-module-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`' />
+ <parameter name='vf.vf-module-data.sdnc-request-header.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.sdnc-request-header.`' />
+ <parameter name='vf.vf-module-data.request-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.request-information.`' />
+ <parameter name='vf.vf-module-data.service-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.`' />
+ <parameter name='vf.vf-module-data.vnf-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.`' />
+ <parameter name='vf.vf-module-data.vf-module-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.`' />
+ <parameter name='vf.vf-module-data.vf-module-topology.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.`' />
+ <parameter name='vf.vf-module-data.vf-module-level-oper-status.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.vf-module-input-parameters.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.vf-module-input-parameters.`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.request-version'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.request-version`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.vf-module-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.vf-module-name`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.tenant'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.tenant`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.aic-cloud-region'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.aic-cloud-region`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.aic-clli'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.aic-clli`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-vfmodule-assignments`"/>
+ <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-vfmodule-url`"/>
+ <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.vnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-vfmodule-url`"/>
+ <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
+ <parameter name="target" value="{vf-module-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.vfmodule.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ss-vfmodule-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ss-vfmodule" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed to persist self-serve vf-module assignments during assign in MD-SAL" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed to persist self-serve vf-module assignments during assign in MD-SAL" />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error from capability: '+ $ss.capability-dg + ', with error: '+ $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <switch test="`$self-serve-generate-name == 'ASSIGNED'`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'SS: self-serve-generate-name status: ' + $self-serve-generate-name`"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'AAI Put is being skipped because NOT all capability components have SUCCESS status; '+ $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <switch test="`$self-serve-unresolved-composite-data == 'ASSIGNED' or $self-serve-unresolved-composite-data == ''`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'SS: self-serve-unresolved-composite-data: ' + $self-serve-unresolved-composite-data`"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'AAI Put is being skipped because NOT all capability components have SUCCESS status; '+ $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.ss.nfc-naming-code' value='' />
+ <parameter name='tmp.ss.nfc-function' value='' />
+ <parameter name='tmp.ss.vnfc-name' value='' />
+ </set>
+ <for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].name`'>
+ <outcome value='vnfc-name'>
+ <!--
+<outcome value='vmxvre_name_0'>
+-->
+ <block>
+ <set>
+ <parameter name='tmp.ss.vnfc-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].value`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.ss.vnfc-name != ''`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <for index="kidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key_length`">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$kidx].name`'>
+ <outcome value='nfc-naming-code'>
+ <!--
+<outcome value='NFC_NAMING_CODE'>
+-->
+ <set>
+ <parameter name='tmp.ss.nfc-naming-code' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ <outcome value='nfc-function'>
+ <set>
+ <parameter name='tmp.ss.nfc-function' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].resource-resolution-data.resource-key[$kidx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.ss.nfc-naming-code != '' and $tmp.ss.nfc-function != ''`">
+ <outcome value='true'>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $tmp.ss.vnfc-name" >
+ <parameter name="nfc-function" value="`$tmp.ss.nfc-function`" />
+ <parameter name="nfc-naming-code" value="`$tmp.ss.nfc-naming-code`" />
+ <parameter name="orchestration-status" value="pending-create" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="Failed to save vnfc object in AAI" />
+ </return>
+ </outcome>
+ </save>
+ </outcome>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'vnfc object not updated because param.value of vnfc-name is null; '+ $error-message`" />
+ </return>
+ </outcome>
+ </switch>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-aai-vfmodule-put' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'generic-vnf and vf-module not updated; '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'SS: vnfc-name: ' + $tmp.ss.vnfc-name`"/>
+ </record>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-vf-assign.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vf-module-unassign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vf-module-unassign.xml
new file mode 100644
index 00000000..5cece27e
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vf-module-unassign.xml
@@ -0,0 +1,224 @@
+<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='self-serve-vf-module-unassign' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='ss.capability.execution-order[0]' value='mac-address-assign' />
+ <parameter name='ss.capability.execution-order[1]' value='eipam-ip-assign' />
+ <parameter name='ss.capability.execution-order[2]' value='vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[3]' value='alts-license-assign' />
+ <parameter name='ss.capability.execution-order[4]' value='alts-entitlement-assign' />
+ <parameter name='ss.capability.execution-order[5]' value='generate-name' />
+ <parameter name='ss.capability.execution-order_length' value='6' />
+ </set>
+ <set>
+ <parameter name='ss.capability-type' value='vf-module' />
+ </set>
+ <for index='cidx' start='0' end='`$ss.capability.execution-order_length`' >
+ <set>
+ <parameter name='ss.capability-name' value='`$ss.capability.execution-order[$cidx]`' />
+ <!--
+ss.capability.execution-order
+-->
+ </set>
+ <set>
+ <parameter name='ss.capability-action' value='unassign' />
+ </set>
+ <switch test='`$ss.capability-name`'>
+ <outcome value='alts-entitlement-assign'>
+ <set>
+ <parameter name='ss.capability-dg' value='self-serve-alts-assignment' />
+ </set>
+ </outcome>
+ <outcome value='alts-license-assign'>
+ <set>
+ <parameter name='ss.capability-dg' value='self-serve-alts-assignment' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='ss.capability-dg' value="`'self-serve-' + $ss.capability.execution-order[$cidx]`" />
+ </set>
+ </outcome>
+ </switch>
+ <for index='pidx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <set>
+ <parameter name='tmp.param.capability-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$ss.capability-name == $tmp.param.capability-name`'>
+ <outcome value='true'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status`'>
+ <outcome value='SUCCESS'>
+ <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
+ <outcome value='success'>
+ <set>
+ <parameter name='`$ss.capability-dg`' value='UNASSIGNED' />
+ </set>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='vf.vf-module-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`' />
+ <parameter name='vf.vf-module-data.sdnc-request-header.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.sdnc-request-header.`' />
+ <parameter name='vf.vf-module-data.request-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.request-information.`' />
+ <parameter name='vf.vf-module-data.service-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.`' />
+ <parameter name='vf.vf-module-data.vnf-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.`' />
+ <parameter name='vf.vf-module-data.vf-module-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.`' />
+ <parameter name='vf.vf-module-data.vf-module-topology.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.`' />
+ <parameter name='vf.vf-module-data.vf-module-level-oper-status.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-level-oper-status.`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.vf-module-input-parameters.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.vf-module-input-parameters.`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.request-version'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.request-version`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.vf-module-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.vf-module-name`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.tenant'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.tenant`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.aic-cloud-region'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.aic-cloud-region`' />
+ <parameter name='vf.vf-module-data.vf-module-request-input.aic-clli'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-request-input.aic-clli`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-vfmodule-assignments`"/>
+ <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.service-information.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-vfmodule-url`"/>
+ <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vnf-information.vnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-vfmodule-url`"/>
+ <parameter name="outputPath" value="tmp.ss-vfmodule-url"/>
+ <parameter name="target" value="{vf-module-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.vfmodule.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ss-vfmodule-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ss-vfmodule" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed to persist self-serve vf-module assignments during unassign in MD-SAL" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed to persist self-serve vf-module assignments during unassign in MD-SAL" />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error from capability: '+ $ss.capability-dg + ', with error: '+ $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='DELETED'>
+ <block>
+ <set>
+ <parameter name='`$ss.capability-dg`' value='UNASSIGNED' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'SS: resource-resolution-data.status: ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status`"/>
+ <parameter name="field2" value="`'SS: ss.capability-name: ' + $ss.capability-name`"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'SS: resource-resolution-data.status: ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status`"/>
+ <parameter name="field2" value="`'SS: ss.capability-name: ' + $ss.capability-name`"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to unassign self-serve vf-module assignments because the status for ' + $ss.capability-name + ' is ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status`"/>
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <switch test="`$self-serve-generate-name == 'UNASSIGNED'`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'SS: self-serve-generate-name status: ' + $self-serve-generate-name`"/>
+ <parameter name="field2" value="`'SS: self-serve-unresolved-composite-data: ' + $self-serve-unresolved-composite-data`"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'AAI Put is being skipped because NOT all capability components have SUCCESS status; '+ $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block atomic='true'>
+ <for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].name`'>
+ <outcome value='vnfc-name'>
+ <!--
+<outcome value='vmxvre_name_0'>
+-->
+ <block>
+ <set>
+ <parameter name='tmp.ss.vnfc-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$i].value`' />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $tmp.ss.vnfc-name" >
+ <outcome value='failure'>
+ <set>
+ <parameter name='error-message' value='Failed to delete vnfc object in AnAI' />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </delete>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-vf-unassign.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vfmodule-ra-assignment.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vfmodule-ra-assignment.xml
new file mode 100644
index 00000000..1d8f6fc4
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vfmodule-ra-assignment.xml
@@ -0,0 +1,213 @@
+<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='self-serve-vfmodule-ra-assignment' mode='sync'>
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate.vnf-se-serv-uuid" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="generateUUID is failed" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name="request-id" value="`$tmp.return.generate.vnf-se-serv-uuid`"/>
+ <parameter name="resource-type" value="`$vf-module-topology-operation-input.vf-module-information.vf-module-type`" />
+ <parameter name="resource-id" value="`$vf-module-topology-operation-input.vf-module-information.vf-module-id`" />
+ <parameter name="action-name" value="resource-assignment-action"/>
+ <parameter name="responsePrefix" value="sriovAssign" />
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='highnum' value='0' />
+ <parameter name='prehighnum' value='0'/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='highnum' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' />
+ <parameter name='prehighnum' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <for index='i' start='0' end='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param_length`' >
+ <switch test='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$i].name`'>
+ <outcome value='sdnc_model_name'>
+ <set>
+ <parameter name='tmp.sdnc-model-name' value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$i].value`' />
+ </set>
+ </outcome>
+ <outcome value='sdnc_model_version'>
+ <set>
+ <parameter name='tmp.sdnc-model-version' value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$i].value`' />
+ </set>
+ </outcome>
+ <outcome value='vf_module_label'>
+ <set>
+ <parameter name='tmp.vf-module-label' value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$i].value`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name="tmp.config-name-value-other-payload" value="`$tmp.config-name-value-other-payload + '&quot;' + $vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$i].name + '&quot;:&quot;' + $vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$i].value + '&quot;,'`"/>
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.sdnc-model-name == '' or $tmp.sdnc-model-version == '' or $tmp.vf-module-label == ''`">
+ <outcome value='true'>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODEL WHERE customization_uuid = $vf-module-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid'
+ pfx='db1.vf-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_MODEL table" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.sdnc-model-name' value='`$db1.vf-model.sdnc-model-name`' />
+ <parameter name='tmp.sdnc-model-version' value='`$db1.vf-model.sdnc-model-version`' />
+ </set>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT vf_module_label from VF_MODULE_MODEL WHERE vf_customization_uuid = $vf-module-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid'
+ pfx='db1.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='success'>
+ <set>
+ <parameter name='tmp.vf-module-label' value='`$db1.vf-module-model.vf-module-label`' />
+ </set>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.config-name-value-payload4" value="`$tmp.config-name-value-other-payload + '&quot;service-instance-id&quot;:&quot;' + $vf-module-topology-operation-input.service-information.service-instance-id + '&quot;,'`"/>
+ <parameter name="tmp.config-name-value-payload5" value="`$tmp.config-name-value-payload4 + '&quot;vnf-id&quot;:&quot;' + $vf-module-topology-operation-input.vnf-information.vnf-id + '&quot;,'`"/>
+ <parameter name="tmp.config-name-value-payload6" value="`$tmp.config-name-value-payload5 + '&quot;vf-module-model-customization-uuid&quot;:&quot;' + $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid + '&quot;,'`"/>
+ <parameter name="tmp.config-name-value-payload7" value="`$tmp.config-name-value-payload6 + '&quot;vnf-model-customization-uuid&quot;:&quot;' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.onap-model-information.model-customization-uuid + '&quot;,'`"/>
+ <parameter name="tmp.config-name-value-payload8" value="`$tmp.config-name-value-payload7 + '&quot;vf-module-id&quot;:&quot;' + $vf-module-topology-operation-input.vf-module-information.vf-module-id + '&quot;,'`"/>
+ <parameter name="tmp.config-name-value-payload9" value="`$tmp.config-name-value-payload8 + '&quot;aic-cloud-region&quot;:&quot;' + $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region + '&quot;'`"/>
+ <parameter name="tmp.config-name-value-payload91" value="`'{' + $tmp.config-name-value-payload9 + '}'`" />
+ </set>
+ <execute plugin='org.openecomp.sdnc.config.assignment.service.ConfigAssignmentNode' method='process'>
+ <parameter name="request-id" value='`$request-id`' />
+ <parameter name="resource-id" value='`$resource-id`' />
+ <parameter name="resource-type" value='`$resource-type`' />
+ <parameter name="action-name" value='`$action-name`' />
+ <parameter name="template-names" value="`'[&quot;' + $tmp.vf-module-label + '&quot;]'`" />
+ <parameter name="service-template-name" value='`$tmp.sdnc-model-name`' />
+ <parameter name="service-template-version" value='`$tmp.sdnc-model-version`' />
+ <parameter name='input-data' value='`$tmp.config-name-value-payload91`' />
+ <parameter name="prifix" value="sriovAssign" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from ConfigAssignmentNode" />
+ </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="Error from ConfigAssignmentNode" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="`'sriovAssign.mashed-data.' + $tmp.vf-module-label`" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="false" />
+ </execute>
+ <for index='i' start='0' end='`$jsonContextPrefix.resource-accumulator-resolved-data_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.mso.param.found' value='false' />
+ </set>
+ <switch test='`$prehighnum &gt; 0`'>
+ <outcome value='true'>
+ <for index='cnt' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$cnt].name == $jsonContextPrefix.resource-accumulator-resolved-data[$i].param-name`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$cnt].value`' value='`$jsonContextPrefix.resource-accumulator-resolved-data[$i].param-value`'/>
+ <parameter name='tmp.mso.param.found' value='true' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.mso.param.found`'>
+ <outcome value='false'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].name`' value='`$jsonContextPrefix.resource-accumulator-resolved-data[$i].param-name`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].value`' value='`$jsonContextPrefix.resource-accumulator-resolved-data[$i].param-value`'/>
+ <parameter name='highnum' value='`$highnum + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <for index='i' start='0' end='`$jsonContextPrefix.capability-data_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='num' value='0' />
+ </set>
+ <for index='j' start='0' end='`$jsonContextPrefix.capability-data[$i].key-mapping_length`' >
+ <block atomic='true'>
+ <for index='l' start='0' end='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].output-key-mapping_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].name`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].output-key-mapping[$l].resource-name`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].value`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].output-key-mapping[$l].resource-value`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.capability-name`' value='`$jsonContextPrefix.capability-data[$i].capability-name`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.status`' value='PENDING'/>
+ </set>
+ <switch test="`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload_length == ''`">
+ <outcome value='true'></outcome>
+ <outcome value='false'>
+ <for index='k' start='0' end='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload_length`' >
+ <block atomic='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.resource-key[$num].name`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload[$k].param-name`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.resource-key[$num].value`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload[$k].param-value`'/>
+ </set>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$highnum].resource-resolution-data.resource-key_length`' value='`$num + 1`'/>
+ <parameter name='num' value='`$num + 1`' />
+ </set>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' value='`$highnum + 1`'/>
+ <parameter name='highnum' value='`$highnum + 1`' />
+ </set>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vlan-tag-assign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vlan-tag-assign.xml
new file mode 100755
index 00000000..db5066db
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vlan-tag-assign.xml
@@ -0,0 +1,262 @@
+<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='self-serve-vlan-tag-assign' mode='sync'>
+ <block atomic='true'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ <outcome value='success'>
+ <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"/>
+ <parameter name="field3" value="self-serve-vlan-tag-assign: read properties file." />
+ </record>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <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"/>
+ <parameter name="field3" value="self-serve-vlan-tag-assign: failed to read properties file." />
+ <parameter name="field4" value="generic-resource-api-dg.properties"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='self-serve-vlan-tag-assign: could not read generic-resource-api properties' />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-capability-param-resolution' mode='sync' ></call>
+ <for index='capIdx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module.param[$capIdx].resource-resolution-data.capability-name == $ss.capability-name`">
+ <outcome value='true'>
+ <switch test="`$ss.capability-action`">
+ <outcome value='assign'>
+ <block atomic='true'>
+ <set>
+ <parameter name='sscap.res-target-type' value='`$prop.restapi.ss.capreserve.targettype`' />
+ </set>
+ <for index='rkIdx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$capIdx].resource-resolution-data.resource-key_length`' >
+ <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$capIdx].resource-resolution-data.resource-key[$rkIdx].name`">
+ <outcome value='vlan-recipe'>
+ <set>
+ <parameter name='sscap.res-service-model' value='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$capIdx].resource-resolution-data.resource-key[$rkIdx].value`' />
+ </set>
+ </outcome>
+ <outcome value='vnf-name'>
+ <set>
+ <parameter name='sscap.res-entity-id' value='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$capIdx].resource-resolution-data.resource-key[$rkIdx].value`' />
+ </set>
+ </outcome>
+ <outcome value='nf-role'>
+ <set>
+ <parameter name='sscap.res-entity-type' value='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$capIdx].resource-resolution-data.resource-key[$rkIdx].value`' />
+ </set>
+ </outcome>
+ <outcome value='aic-site-id'>
+ <set>
+ <parameter name='sscap.res-target-id' value='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$capIdx].resource-resolution-data.resource-key[$rkIdx].value`' />
+ </set>
+ </outcome>
+ <outcome value='vlan-tag-type'>
+ <set>
+ <parameter name='sscap.res-endpoint-position' value='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$capIdx].resource-resolution-data.resource-key[$rkIdx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <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"/>
+ <parameter name="field3" value="self-serve-vlan-tag-assign: reserve params"/>
+ <parameter name="field4" value='`$sscap.res-service-model`'/>
+ <parameter name="field5" value='`$sscap.res-entity-type`'/>
+ <parameter name="field6" value='`$sscap.res-entity-id`'/>
+ <parameter name="field7" value='`$sscap.res-target-type.`' />
+ <parameter name="field8" value='`$sscap.res-target-id`'/>
+ <parameter name="field9" value='`$sscap.res.endpoint-position`' />
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.capreserve.templatefile`" />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='post' />
+ <parameter name='responsePrefix' value='tmp.sscapres-response' />
+ <outcome value='failure'>
+ <block>
+ <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"/>
+ <parameter name="field3" value="self-serve-vlan-tag-assign: restapi reserve execution failed"/>
+ </record>
+ <set>
+ <parameter name='sscap.reserve.response-code' value='500' />
+ <parameter name='sscap.reserve.response-message' value='Self Serve Capacity Api restapi reserve execution failed' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-mofule[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$capIdx].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='self-serve-vlan-tag-assign: reserve failed' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <switch test="`$tmp.sscapres-response.response-code`">
+ <outcome value='200'>
+ <block>
+ <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"/>
+ <parameter name="field3" value="self-serve-vlan-tag-assign: reserve successful"/>
+ <parameter name="field4" value='`$tmp.sscapres-response.response-code`'/>
+ <parameter name="field5" value='`$tmp.sscapres-response.response-message`'/>
+ <parameter name="field6" value='`$tmp.sscapres-response.output.reservation-entity-list[0].reservation-target-list[0].resource-list[0].allocated`' />
+ <parameter name="field7" value='`$tmp.sscapres-response.output.reservation-entity-list[0].reservation-target-list[0].resource-list[0].end-point-position`' />
+ </record>
+ <set>
+ <parameter name='pmIdx' value='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-mofule[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-mofule[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$capIdx].resource-resolution-data.status' value='SUCCESS' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-mofule[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pmIdx].value' value='$tmp.sscapres-response.output.reservation-entity-list[0].reservation-target-list[0].resource-list[0].allocated' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-mofule[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pmIdx].name' value='$tmp.sscapres-response.output.reservation-entity-list[0].reservation-target-list[0].resource-list[0].end-point-position' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <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"/>
+ <parameter name="field3" value="self-serve-vlan-tag-assign: reserve failed"/>
+ <parameter name="field4" value='`$tmp.sscapres-response.response-code`'/>
+ <parameter name="field5" value='`$tmp.sscapres-response.response-message`'/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-mofule[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$capIdx].resource-resolution-data.status' value='FAILED' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='unassign'>
+ <block atomic='true'>
+ <for index='rkIdx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$capIdx].resource-resolution-data.resource-key_length`' >
+ <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$capIdx].resource-resolution-data.resource-key[$rkIdx].name`">
+ <outcome value='vnf-name'>
+ <set>
+ <parameter name='sscap.rel-entity-id' value='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$capIdx].resource-resolution-data.resource-key[$rkIdx].value`' />
+ </set>
+ </outcome>
+ <outcome value='nf-role'>
+ <set>
+ <parameter name='sscap.rel-entity-type' value='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$capIdx].resource-resolution-data.resource-key[$rkIdx].value`' />
+ </set>
+ </outcome>
+ <outcome value='vlan-tag-type'>
+ <set>
+ <parameter name='sscap.rel-endpoint-position' value='`service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$capIdx].resource-resolution-data.resource-key[$rkIdx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <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"/>
+ <parameter name="field3" value="self-serve-vlan-tag-assign: release params"/>
+ <parameter name="field4" value='`$sscap.res-entity-type`'/>
+ <parameter name="field5" value='`$sscap.res-entity-id`'/>
+ <parameter name="field6" value='`$sscap.res.endpoint-position`' />
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.caprelease.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='post' />
+ <parameter name='responsePrefix' value='tmp.sscaprel-response' />
+ <outcome value='failure'>
+ <block>
+ <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"/>
+ <parameter name="field3" value="self-serve-vlan-tag-assign: restapi release execution failed"/>
+ </record>
+ <set>
+ <parameter name='sscap.release.response-code' value='500' />
+ <parameter name='sscap.release.response-message' value='Self Serve Capacity Api restapi release execution failed' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-mofule[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$capIdx].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='self-serve-vlan-tag-assign: release failed' />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <switch test="`$tmp.sscaprel-response.response-code`">
+ <outcome value='200'>
+ <block>
+ <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"/>
+ <parameter name="field3" value="self-serve-vlan-tag-assign: release successful"/>
+ <parameter name="field4" value='`$tmp.sscaprel-response.response-code`'/>
+ <parameter name="field5" value='`$tmp.sscaprel-response.response-message`'/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-mofule[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$capIdx].resource-resolution-data.status' value='DELETED' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <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"/>
+ <parameter name="field3" value="self-serve-vlan-tag-assign: release failed"/>
+ <parameter name="field4" value='`$tmp.sscaprel-response.response-code`'/>
+ <parameter name="field5" value='`$tmp.sscaprel-response.response-message`'/>
+ </record>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-mofule[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$capIdx].resource-resolution-data.status' value='FAILED' />
+ </set>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='self-serve-vlan-tag-assign: release failed' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <return status='success'>
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vnf-assign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vnf-assign.xml
new file mode 100644
index 00000000..efc55ab8
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vnf-assign.xml
@@ -0,0 +1,490 @@
+<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='self-serve-vnf-assign' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='is-new-vnf' value='true' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='0' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf_length' value='1' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='0' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf_length' value='1' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$vnf-topology-operation-input.vnf-information.vnf-id == $service-data.vnfs.vnf[$idx].vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='is-new-vnf' value='false' />
+ </set>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$is-new-vnf`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='`$service-data.vnfs.vnf_length`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf_length' value='`$service-data.vnfs.vnf_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$is-new-vnf`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-id'
+ value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-type'
+ value='`$vnf-topology-operation-input.vnf-information.vnf-type`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-type'
+ value='`$db.vf-model.nf-type`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-role'
+ value='`$db.vf-model.nf-role`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-function'
+ value='`$db.vf-model.nf-function`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-code'
+ value='`$db.vf-model.nf-code`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.tenant'
+ value='`$vnf-topology-operation-input.vnf-request-input.tenant`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.aic-cloud-region'
+ value='`$vnf-topology-operation-input.vnf-request-input.aic-cloud-region`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-id'
+ value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ </set>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-invariant-uuid'
+ value='`$db.vf-model.invariant-uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-invariant-uuid'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-uuid'
+ value='`$db.vf-model.uuid`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-uuid'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-version`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-version'
+ value='`$db.vf-model.version`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-version'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-version`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-name'
+ value='`$db.vf-model.name`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-name'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-name`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-customization-uuid'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.'
+ value='$vnf-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.'
+ value='$vnf-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.'
+ value='$vnf-topology-operation-input.service-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.'
+ value='$vnf-topology-operation-input.vnf-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.'
+ value='$vnf-topology-operation-input.vnf-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='PendingCreate' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='ss.capability.execution-order[0]' value='generate-name' />
+ <parameter name='ss.capability.execution-order[1]' value='alts-entitlement-assign' />
+ <parameter name='ss.capability.execution-order[2]' value='alts-license-assign' />
+ <parameter name='ss.capability.execution-order[3]' value='vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[4]' value='eipam-ip-assign' />
+ <parameter name='ss.capability.execution-order[5]' value='eipam-create-pool"' />
+ <parameter name='ss.capability.execution-order[6]' value='mac-address-assign' />
+ <parameter name='ss.capability.execution-order[7]' value='create-vpe-pool' />
+ <parameter name='ss.capability.execution-order[8]' value='unresolved-composite-data' />
+ <parameter name='ss.capability.execution-order_length' value='9' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.sdnc-generated-cloud-resources' value='true' />
+ </set>
+ <set>
+ <parameter name='ss.capability-type' value='vnf' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`'>
+ <outcome value=''>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.'
+ value='vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-ra-assignment' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to get RA assignments: ' + $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ <for index='cidx' start='0' end='`$ss.capability.execution-order_length`' >
+ <set>
+ <parameter name='ss.capability-name' value='`$ss.capability.execution-order[$cidx]`' />
+ <!--
+ss.capability.execution-order[]
+-->
+ </set>
+ <set>
+ <parameter name='ss.capability-action' value='assign' />
+ </set>
+ <switch test='`$ss.capability-name`'>
+ <outcome value='alts-entitlement-assign'>
+ <set>
+ <parameter name='ss.capability-dg' value='self-serve-alts-assignment' />
+ </set>
+ </outcome>
+ <outcome value='alts-license-assign'>
+ <set>
+ <parameter name='ss.capability-dg' value='self-serve-alts-assignment' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='ss.capability-dg' value="`'self-serve-' + $ss.capability.execution-order[$cidx]`" />
+ </set>
+ </outcome>
+ </switch>
+ <for index='pidx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <set>
+ <parameter name='tmp.param.capability-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$ss.capability-name == $tmp.param.capability-name`'>
+ <outcome value='true'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status`'>
+ <outcome value='SUCCESS'>
+ <set>
+ <parameter name='`$ss.capability-dg`' value='ASSIGNED' />
+ </set>
+ </outcome>
+ <outcome value='PENDING'>
+ <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='vf.vnf-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-id`' />
+ <parameter name='vf.vnf-data.sdnc-request-header.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.`' />
+ <parameter name='vf.vnf-data.request-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.`' />
+ <parameter name='vf.vnf-data.service-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.`' />
+ <parameter name='vf.vnf-data.vnf-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.`' />
+ <parameter name='vf.vnf-data.vnf-topology.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.`' />
+ <parameter name='vf.vnf-data.vnf-level-oper-status.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.`' />
+ <parameter name='vf.vnf-data.vnf-request-input.vnf-input-parameters.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.vnf-input-parameters.`' />
+ <parameter name='vf.vnf-data.vnf-request-input.request-version'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.request-version`' />
+ <parameter name='vf.vnf-data.vnf-request-input.vnf-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.vnf-name`' />
+ <parameter name='vf.vnf-data.vnf-request-input.tenant'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.tenant`' />
+ <parameter name='vf.vnf-data.vnf-request-input.aic-cloud-region'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.aic-cloud-region`' />
+ <parameter name='vf.vnf-data.vnf-request-input.aic-clli'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.aic-clli`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-vnf-assignments`"/>
+ <parameter name="outputPath" value="tmp.ss-vnf-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-vnf-url`"/>
+ <parameter name="outputPath" value="tmp.ss-vnf-url"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.vnf.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ss-vnf-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ss-vnf" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed to persist self-serve vnf assignments during assign in MD-SAL" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed to persist self-serve vnf assignments during assign in MD-SAL" />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error from capability: '+ $ss.capability-dg + ', with error: '+ $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='`$ss.capability-dg`' value='ASSIGNED' />
+ </set>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='FAILED'>
+ <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='vf.vnf-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-id`' />
+ <parameter name='vf.vnf-data.sdnc-request-header.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.`' />
+ <parameter name='vf.vnf-data.request-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.`' />
+ <parameter name='vf.vnf-data.service-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.`' />
+ <parameter name='vf.vnf-data.vnf-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.`' />
+ <parameter name='vf.vnf-data.vnf-topology.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.`' />
+ <parameter name='vf.vnf-data.vnf-level-oper-status.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.`' />
+ <parameter name='vf.vnf-data.vnf-request-input.vnf-input-parameters.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.vnf-input-parameters.`' />
+ <parameter name='vf.vnf-data.vnf-request-input.request-version'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.request-version`' />
+ <parameter name='vf.vnf-data.vnf-request-input.vnf-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.vnf-name`' />
+ <parameter name='vf.vnf-data.vnf-request-input.tenant'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.tenant`' />
+ <parameter name='vf.vnf-data.vnf-request-input.aic-cloud-region'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.aic-cloud-region`' />
+ <parameter name='vf.vnf-data.vnf-request-input.aic-clli'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.aic-clli`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-vnf-assignments`"/>
+ <parameter name="outputPath" value="tmp.ss-vnf-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-vnf-url`"/>
+ <parameter name="outputPath" value="tmp.ss-vnf-url"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.vnf.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ss-vnf-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ss-vnf" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed to persist self-serve vnf assignments during assign in MD-SAL" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed to persist self-serve vnf assignments during assign in MD-SAL" />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error from capability: '+ $ss.capability-dg + ', with error: '+ $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='`$ss.capability-dg`' value='ASSIGNED' />
+ </set>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <switch test="`$self-serve-generate-name == 'ASSIGNED'`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'SS: self-serve-generate-name status: ' + $self-serve-generate-name`"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'AAI Put is being skipped because NOT all capability components have SUCCESS status; '+ $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <switch test="`$self-serve-unresolved-composite-data == 'ASSIGNED' or $self-serve-unresolved-composite-data == ''`">
+ <outcome value='false'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'SS: self-serve-unresolved-composite-data: ' + $self-serve-unresolved-composite-data`"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'AAI Put is being skipped because NOT all capability components have SUCCESS status; '+ $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block atomic='true'>
+ <for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].name`'>
+ <outcome value='vnf_name'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.ss.vnf-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$i].value`' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id "
+ pfx="tmp.aai.update.vnf" >
+ <parameter name="vnf-name" value='`$tmp.ss.vnf-name`' />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update generic-vnf.vnf-name in AnAI with vnf-name=' + $tmp.ss.vnf-name`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to update generic-vnf.vnf-name because generic-vnf with vnf-name=' + $tmp.ss.vnf-name + ' is not found in AAI'`" />
+ </return>
+ </outcome>
+ </update>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.ss.vnf-name`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'generic-vnf not updated because vnf-name param.value is null; '+ $error-message`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-vnf-assign.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vnf-ra-assignment.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vnf-ra-assignment.xml
new file mode 100644
index 00000000..ac31f90d
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vnf-ra-assignment.xml
@@ -0,0 +1,199 @@
+<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='self-serve-vnf-ra-assignment' mode='sync'>
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
+ <parameter name="ctx-destination" value="tmp.return.generate.vnf-se-serv-uuid" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="generateUUID is failed" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name="request-id" value="`$tmp.return.generate.vnf-se-serv-uuid`"/>
+ <parameter name="resource-type" value="`$vnf-topology-operation-input.vnf-information.vnf-type`" />
+ <parameter name="resource-id" value="`$vnf-topology-operation-input.vnf-information.vnf-id`" />
+ <parameter name="action-name" value="resource-assignment-action"/>
+ <parameter name="responsePrefix" value="sriovAssign" />
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='highnum' value='0' />
+ <parameter name='prehighnum' value='0'/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='highnum' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' />
+ <parameter name='prehighnum' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <for index='i' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`' >
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$i].name`'>
+ <outcome value='sdnc_model_name'>
+ <set>
+ <parameter name='tmp.sdnc-model-name' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$i].value`' />
+ </set>
+ </outcome>
+ <outcome value='sdnc_model_version'>
+ <set>
+ <parameter name='tmp.sdnc-model-version' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$i].value`' />
+ </set>
+ </outcome>
+ <outcome value='sdnc_artifact_name'>
+ <set>
+ <parameter name='tmp.sdnc-artifact-name' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$i].value`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name="tmp.config-name-value-other-payload" value="`$tmp.config-name-value-other-payload + '&quot;' + $vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$i].name + '&quot;:&quot;' + $vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$i].value + '&quot;,'`"/>
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$tmp.sdnc-model-name == '' or $tmp.sdnc-model-version == '' or $tmp.sdnc-artifact-name == ''`">
+ <outcome value='true'>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODEL WHERE customization_uuid = $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid'
+ pfx='db1.vf-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="Error reading VF_MODULE_MODEL table" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.sdnc-model-name' value='`$db1.vf-model.sdnc-model-name`' />
+ <parameter name='tmp.sdnc-model-version' value='`$db1.vf-model.sdnc-model-version`' />
+ <parameter name='tmp.sdnc-artifact-name' value='`$db1.vf-model.sdnc-artifact-name`' />
+ </set>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.config-name-value-payload4" value="`$tmp.config-name-value-other-payload + '&quot;service-instance-id&quot;:&quot;' + $vnf-topology-operation-input.service-information.service-instance-id + '&quot;,'`"/>
+ <parameter name="tmp.config-name-value-payload5" value="`$tmp.config-name-value-payload4 + '&quot;vnf-model-customization-uuid&quot;:&quot;' + $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid + '&quot;,'`"/>
+ <parameter name="tmp.config-name-value-payload6" value="`$tmp.config-name-value-payload5 + '&quot;vnf-id&quot;:&quot;' + $vnf-topology-operation-input.vnf-information.vnf-id + '&quot;,'`"/>
+ <parameter name="tmp.config-name-value-payload7" value="`$tmp.config-name-value-payload6 + '&quot;aic-cloud-region&quot;:&quot;' + $vnf-topology-operation-input.vnf-request-input.aic-cloud-region + '&quot;'`"/>
+ <parameter name="tmp.json-payload" value="`'{' + $tmp.config-name-value-payload7 + '}'`" />
+ </set>
+ <execute plugin='org.openecomp.sdnc.config.assignment.service.ConfigAssignmentNode' method='process'>
+ <parameter name="request-id" value='`$request-id`' />
+ <parameter name="resource-id" value='`$resource-id`' />
+ <parameter name="resource-type" value='`$resource-type`' />
+ <parameter name="action-name" value='`$action-name`' />
+ <parameter name="template-names" value="`'[&quot;' + $tmp.sdnc-artifact-name + '&quot;]'`" />
+ <parameter name="service-template-name" value='`$tmp.sdnc-model-name`' />
+ <parameter name="service-template-version" value='`$tmp.sdnc-model-version`' />
+ <parameter name='input-data' value='`$tmp.json-payload`' />
+ <parameter name="prifix" value="sriovAssign" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error from ConfigAssignmentNode" />
+ </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="Error from ConfigAssignmentNode" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
+ <parameter name="source" value="`'sriovAssign.mashed-data.' + $tmp.sdnc-artifact-name`" />
+ <parameter name="outputPath" value="jsonContextPrefix" />
+ <parameter name="isEscaped" value="false" />
+ </execute>
+ <for index='i' start='0' end='`$jsonContextPrefix.resource-accumulator-resolved-data_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.mso.param.found' value='false' />
+ </set>
+ <switch test='`$prehighnum &gt; 0`'>
+ <outcome value='true'>
+ <for index='cnt' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$cnt].name == $jsonContextPrefix.resource-accumulator-resolved-data[$i].param-name`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$cnt].value`' value='`$jsonContextPrefix.resource-accumulator-resolved-data[$i].param-value`'/>
+ <parameter name='tmp.mso.param.found' value='true' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.mso.param.found`'>
+ <outcome value='false'>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].name`' value='`$jsonContextPrefix.resource-accumulator-resolved-data[$i].param-name`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].value`' value='`$jsonContextPrefix.resource-accumulator-resolved-data[$i].param-value`'/>
+ <parameter name='highnum' value='`$highnum + 1`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <for index='i' start='0' end='`$jsonContextPrefix.capability-data_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='num' value='0' />
+ </set>
+ <for index='j' start='0' end='`$jsonContextPrefix.capability-data[$i].key-mapping_length`' >
+ <block atomic="true">
+ <for index='l' start='0' end='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].output-key-mapping_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].name`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].output-key-mapping[$l].resource-name`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].value`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].output-key-mapping[$l].resource-value`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.capability-name`' value='`$jsonContextPrefix.capability-data[$i].capability-name`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.status`' value='PENDING'/>
+ </set>
+ <switch test="`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload_length == ''`">
+ <outcome value='true'></outcome>
+ <outcome value='false'>
+ <for index='k' start='0' end='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload_length`' >
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.resource-key[$num].name`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload[$k].param-name`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.resource-key[$num].value`' value='`$jsonContextPrefix.capability-data[$i].key-mapping[$j].payload[$k].param-value`'/>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$highnum].resource-resolution-data.resource-key_length`' value='`$num + 1`'/>
+ <parameter name='num' value='`$num + 1`' />
+ </set>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' value='`$highnum + 1`'/>
+ <parameter name='highnum' value='`$highnum + 1`' />
+ </set>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vnf-unassign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vnf-unassign.xml
new file mode 100644
index 00000000..968a4595
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-vnf-unassign.xml
@@ -0,0 +1,153 @@
+<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='self-serve-vnf-unassign' mode='sync'>
+ <block atomic='true'>
+ <set>
+ <parameter name='ss.capability.execution-order[0]' value='mac-address-assign' />
+ <parameter name='ss.capability.execution-order[1]' value='eipam-ip-assign' />
+ <parameter name='ss.capability.execution-order[2]' value='vlan-tag-assign' />
+ <parameter name='ss.capability.execution-order[3]' value='alts-license-assign' />
+ <parameter name='ss.capability.execution-order[4]' value='alts-entitlement-assign' />
+ <parameter name='ss.capability.execution-order[5]' value='generate-name' />
+ <parameter name='ss.capability.execution-order_length' value='6' />
+ </set>
+ <set>
+ <parameter name='ss.capability-type' value='vnf' />
+ </set>
+ <for index='cidx' start='0' end='`$ss.capability.execution-order_length`' >
+ <set>
+ <parameter name='ss.capability-name' value='`$ss.capability.execution-order[$cidx]`' />
+ <!--
+ss.capability.execution-order[]
+-->
+ </set>
+ <set>
+ <parameter name='ss.capability-action' value='unassign' />
+ </set>
+ <switch test='`$ss.capability-name`'>
+ <outcome value='alts-entitlement-assign'>
+ <set>
+ <parameter name='ss.capability-dg' value='self-serve-alts-assignment' />
+ </set>
+ </outcome>
+ <outcome value='alts-license-assign'>
+ <set>
+ <parameter name='ss.capability-dg' value='self-serve-alts-assignment' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='ss.capability-dg' value="`'self-serve-' + $ss.capability.execution-order[$cidx]`" />
+ </set>
+ </outcome>
+ </switch>
+ <for index='pidx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <set>
+ <parameter name='tmp.param.capability-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.capability-name`' />
+ </set>
+ <switch test='`$ss.capability-name == $tmp.param.capability-name`'>
+ <outcome value='true'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status`'>
+ <outcome value='SUCCESS'>
+ <call module='GENERIC-RESOURCE-API' rpc='`$ss.capability-dg`' mode='sync' >
+ <outcome value='success'>
+ <set>
+ <parameter name='`$ss.capability-dg`' value='UNASSIGNED' />
+ </set>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic='true'>
+ <set>
+ <parameter name='vf.vnf-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-id`' />
+ <parameter name='vf.vnf-data.sdnc-request-header.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.`' />
+ <parameter name='vf.vnf-data.request-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.`' />
+ <parameter name='vf.vnf-data.service-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.`' />
+ <parameter name='vf.vnf-data.vnf-information.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.`' />
+ <parameter name='vf.vnf-data.vnf-request-input.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.`' />
+ <parameter name='vf.vnf-data.vnf-request-input.vnf-input-parameters.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.vnf-input-parameters.`' />
+ <parameter name='vf.vnf-data.vnf-topology.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.`' />
+ <parameter name='vf.vnf-data.vnf-level-oper-status.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.ss-vnf-assignments`"/>
+ <parameter name="outputPath" value="tmp.ss-vnf-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ss-vnf-url`"/>
+ <parameter name="outputPath" value="tmp.ss-vnf-url"/>
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$service-data.vnfs.vnf[$vnf-index].vnf-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.ss.vnf.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ss-vnf-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ss-vnf" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error persisting self-serve vnf assignments in MD-SAL during unassign" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Error persisting self-serve vnf assignments in MD-SAL during unassign" />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to unassign self-serve vnf assignments for ' + $ss.capability-dg + ' with error: ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='DELETED'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="`'SS: resource-resolution-data.status: ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status`"/>
+ <parameter name="field2" value="`'SS: ss.capability-name: ' + $ss.capability-name`"/>
+ </record>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to unassign self-serve vnf assignments because the status for ' + $ss.capability-name + ' is ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$pidx].resource-resolution-data.status`"/>
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-vnf-assign.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation-assign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation-assign.xml
index ec375552..dda220aa 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation-assign.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation-assign.xml
@@ -1,123 +1,227 @@
-<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='service-topology-operation-assign' mode='sync'>
-<block atomic="true"><switch test='`$service-topology-operation-input.request-information.request-action`'>
-<outcome value='CreateServiceInstance'>
-<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 'CreateServiceInstance'" />
-</return></outcome></switch><switch test='`$service-data.service-level-oper-status.order-status`'>
-<outcome value=''><block>
-</block></outcome><outcome value='Created'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="The requested service already exists" />
-</return></outcome><outcome value='PendingDelete'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="The requested service is pending deletion" />
-</return></outcome></switch><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+<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='service-topology-operation-assign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$service-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateServiceInstance'>
+ <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 'CreateServiceInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key='SELECT * from SERVICE_MODEL WHERE service_uuid = $service-topology-operation-input.service-information.onap-model-information.model-uuid'
pfx='db.service-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 SERVICE_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 service UUID ' + $service-topology-operation-input.service-information.onap-model-information.model-uuid`" />
-</return></outcome></get-resource><switch test='`$service-topology-operation-input.service-request-input.service-instance-name`'>
-<outcome value=''><block atomic="true"><switch test='`$db.service-model.ecomp-naming`'>
-<outcome value='Y'><block>
-</block></outcome><outcome value='N'><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="No service-instance-name was received but ecomp-naming is not Y" />
-</return></outcome><outcome value='Other'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="No service-instance-name was received but ecomp-naming is not Y" />
-</return></outcome></switch><set>
-<parameter name='generate-unique-name-input.index-table-name' value='SERVICE_INSTANCE_NAME_INDEX' />
-<parameter name='generate-unique-name-input.index-table-prefix-column' value='service_instance_name_prefix' />
-<parameter name='generate-unique-name-input.name-table-type' value='SERVICE_INSTANCE' />
-<parameter name='generate-unique-name-input.prefix' value="`$db.service-model.service-instance-name-prefix + '_'`" />
-</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.service-instance-name' value='`$generate-unique-name-output.generated-name`' />
-</set></outcome></call></block></outcome><outcome value='Other'>
-<block atomic="true"><set>
-<parameter name='generate-unique-name-input.name-table-type' value='SERVICE_INSTANCE' />
-<parameter name='generate-unique-name-input.supplied-name' value='`$service-topology-operation-input.service-request-input.service-instance-name`' />
-</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.service-instance-name' value="`$service-topology-operation-input.service-request-input.service-instance-name`" />
-</set></outcome></call></block></outcome></switch><set>
-<parameter name='service-object-path'
+ <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 SERVICE_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 service UUID ' + $service-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.service-instance-name' value='' />
+ </set>
+ <switch test='`$service-topology-operation-input.service-request-input.service-instance-name`'>
+ <outcome value=''>
+ <block atomic="true">
+ <switch test='`$db.service-model.ecomp-naming`'>
+ <outcome value='Y'>
+ <block></block>
+ </outcome>
+ <outcome value='N'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No service-instance-name was received but ecomp-naming is not Y" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No service-instance-name was received but ecomp-naming is not Y" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$db.service-model.naming-policy`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-input.action' value='ASSIGN' />
+ <parameter name='generate-unique-name-input.context-id' value='`$service-topology-operation-input.service-information.service-instance-id`' />
+ <parameter name='generate-unique-name-input.index-table-name' value='SERVICE_INSTANCE_NAME_INDEX' />
+ <parameter name='generate-unique-name-input.index-table-prefix-column' value='service_instance_name_prefix' />
+ <parameter name='generate-unique-name-input.name-table-type' value='SERVICE_INSTANCE' />
+ <parameter name='generate-unique-name-input.prefix' value="`$db.service-model.service-instance-name-prefix + '_'`" />
+ </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.service-instance-name' value='`$generate-unique-name-output.generated-name`' />
+ </set>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='generated-via-policy' value='true' />
+ </set>
+ <set>
+ <parameter name='naming-policy-generate-name-input.policy-instance-name' value='`$db.service-model.naming-policy`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='SERVICE' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$service-topology-operation-input.service-information.service-instance-id`' />
+ <parameter name='naming-policy-generate-name-input.query-parameter' value='`$db.service-model.service-uuid`' />
+ <parameter name='naming-policy-generate-name-input.action' value='ASSIGN' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-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="Unable to generate service name" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.service-instance-name' value='`$naming-policy-generate-name-output.service-name`' />
+ </set>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-input.name-table-type' value='SERVICE_INSTANCE' />
+ <parameter name='generate-unique-name-input.supplied-name' value='`$service-topology-operation-input.service-request-input.service-instance-name`' />
+ </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.service-instance-name' value="`$service-topology-operation-input.service-request-input.service-instance-name`" />
+ </set>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-object-path'
value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ $service-topology-operation-input.service-information.service-instance-id
+ '/service-data/service-topology/'`"/>
-</set><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="service-instance"
key="customer.global-customer-id = $service-topology-operation-input.service-information.global-customer-id AND
service-subscription.service-type = $service-topology-operation-input.service-information.subscription-service-type AND
service-instance.service-instance-id = $service-topology-operation-input.service-information.service-instance-id"
pfx='pfx' local-only='false' force='false'>
- <parameter name="service-instance-name" value="`$tmp.service-instance-name`" />
- <parameter name="selflink" value="`$service-object-path`" />
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="AAI failed" />
-</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="The service instance does not exist in AAI" />
-</return></outcome></update><set>
-<parameter name='service-data.service-topology.service-topology-identifier.service-instance-id'
+ <parameter name="service-instance-name" value="`$tmp.service-instance-name`" />
+ <parameter name="selflink" value="`$service-object-path`" />
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='SERVICE' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$service-topology-operation-input.service-information.service-instance-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failure calling AAI to update the service instance" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='SERVICE' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$service-topology-operation-input.service-information.service-instance-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="The service instance does not exist in AAI" />
+ </return>
+ </block>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='service-data.service-topology.service-topology-identifier.service-instance-id'
value='`$service-topology-operation-input.service-information.service-instance-id`' />
-<parameter name='service-data.service-topology.service-topology-identifier.service-type'
+ <parameter name='service-data.service-topology.service-topology-identifier.service-type'
value='`$service-topology-operation-input.service-information.subscription-service-type`' />
-<parameter name='service-data.service-topology.service-topology-identifier.service-instance-name'
+ <parameter name='service-data.service-topology.service-topology-identifier.service-instance-name'
value='`$tmp.service-instance-name`' />
-<parameter name='service-data.service-topology.service-topology-identifier.global-customer-id'
+ <parameter name='service-data.service-topology.service-topology-identifier.global-customer-id'
value='`$service-topology-operation-input.service-information.global-customer-id`' />
-</set><set>
-<parameter name='service-data.service-topology.onap-model-information.'
+ </set>
+ <set>
+ <parameter name='service-data.service-topology.onap-model-information.'
value='`$service-topology-operation-input.service-information.onap-model-information.`' />
-</set><switch test='`$service-topology-operation-input.service-request-input.service-input-parameters.param_length`'>
-<outcome value=''><block>
-</block></outcome><outcome value='Other'>
-<for index='idx' start='0' end='`$service-topology-operation-input.service-request-input.service-input-parameters.param_length`' >
-<set>
-<parameter name='service-data.service-topology.service-parameters[$idx].service-parameter-name'
+ </set>
+ <switch test='`$service-topology-operation-input.service-request-input.service-input-parameters.param_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <for index='idx' start='0' end='`$service-topology-operation-input.service-request-input.service-input-parameters.param_length`' >
+ <set>
+ <parameter name='service-data.service-topology.service-parameters[$idx].service-parameter-name'
value='`$service-topology-operation-input.service-request-input.service-input-parameters.param[$idx].name`' />
-<parameter name='service-data.service-topology.service-parameters[$idx].service-parameter-value'
+ <parameter name='service-data.service-topology.service-parameters[$idx].service-parameter-value'
value='`$service-topology-operation-input.service-request-input.service-input-parameters.param[$idx].value`' />
-</set></for></outcome></switch><set>
-<parameter name='service-data.service-level-oper-status.order-status' value='Created' />
-<parameter name='service-data.service-level-oper-status.last-rpc-action' value='assign' />
-<parameter name='service-data.service-level-oper-status.last-action' value='CreateServiceInstance' />
-</set></block></method></service-logic>
+ </set>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.service-level-oper-status.order-status' value='Created' />
+ <parameter name='service-data.service-level-oper-status.last-rpc-action' value='assign' />
+ <parameter name='service-data.service-level-oper-status.last-action' value='CreateServiceInstance' />
+ </set>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation-changeassign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation-changeassign.xml
new file mode 100755
index 00000000..c018b1ab
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation-changeassign.xml
@@ -0,0 +1,63 @@
+<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='service-topology-operation-changeassign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$service-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateServiceInstance'>
+ <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 'changeassign' then request-action must be 'CreateServiceInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.service-topology.service-topology-identifier.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'Service ' + $service-topology-operation-input.service-information.service-instance-id + ' is not found'`" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from SERVICE_MODEL WHERE service_uuid = $service-topology-operation-input.service-information.onap-model-information.model-uuid'
+ pfx='db.service-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 SERVICE_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 service UUID ' + $service-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='service-data.service-topology.onap-model-information.'
+ value='`$service-topology-operation-input.service-information.onap-model-information.`' />
+ </set>
+ <set>
+ <parameter name='service-data.service-level-oper-status.order-status' value='Created' />
+ <parameter name='service-data.service-level-oper-status.last-rpc-action' value='changeassign' />
+ <parameter name='service-data.service-level-oper-status.last-action' value='CreateServiceInstance' />
+ </set>
+ <set>
+ <parameter name='service-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $service-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <return status='success'></return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation-deactivate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation-deactivate.xml
index ca82647e..89cc3eb0 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation-deactivate.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation-deactivate.xml
@@ -1,42 +1,67 @@
-<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='service-topology-operation-deactivate' mode='sync'>
-<block atomic="true"><switch test='`$service-data.service-topology.service-topology-identifier.service-instance-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="404" />
- <parameter name="error-message" value="`'Service ' + $service-topology-operation-input.service-information.service-instance-id + ' is not found'`" />
-</return></outcome></switch><switch test='`$service-topology-operation-input.request-information.request-action`'>
-<outcome value='DeleteServiceInstance'>
-<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 'deactivate' then request-action must be 'DeleteServiceInstance'" />
-</return></outcome></switch><switch test='`$service-data.provided-allotted-resources.provided-allotted-resource_length`'>
-<outcome value='0'>
-<block>
-</block></outcome><outcome value=''><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="Cannot deactivate this service because there are provided allotted resources" />
-</return></outcome></switch><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+<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='service-topology-operation-deactivate' mode='sync'>
+ <block atomic="true">
+ <switch test='`$service-data.service-topology.service-topology-identifier.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'Service ' + $service-topology-operation-input.service-information.service-instance-id + ' is not found'`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteServiceInstance'>
+ <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 'deactivate' then request-action must be 'DeleteServiceInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.provided-allotted-resources.provided-allotted-resource_length`'>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value=''>
+ <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="Cannot deactivate this service because there are provided allotted resources" />
+ </return>
+ </outcome>
+ </switch>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="service-instance"
key="customer.global-customer-id = $service-data.service-topology.service-topology-identifier.global-customer-id AND
service-subscription.service-type = $service-data.service-topology.service-topology-identifier.service-type AND
service-instance.service-instance-id = $service-topology-operation-input.service-information.service-instance-id"
pfx='pfx' local-only='false' force='false'>
- <parameter name="orchestration-status" value="PendingDelete" />
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="AAI failed" />
-</return></outcome><outcome value='not-found'>
-<block>
-</block></outcome></update><set>
-<parameter name='service-data.service-level-oper-status.order-status' value='PendingDelete' />
-<parameter name='service-data.service-level-oper-status.last-rpc-action' value='deactivate' />
-<parameter name='service-data.service-level-oper-status.last-action' value='DeleteServiceInstance' />
-</set></block></method></service-logic>
+ <parameter name="orchestration-status" value="PendingDelete" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='service-data.service-level-oper-status.order-status' value='PendingDelete' />
+ <parameter name='service-data.service-level-oper-status.last-rpc-action' value='deactivate' />
+ <parameter name='service-data.service-level-oper-status.last-action' value='DeleteServiceInstance' />
+ </set>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation-delete.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation-delete.xml
index 88ae84bc..52708748 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation-delete.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation-delete.xml
@@ -1,62 +1,100 @@
-<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='service-topology-operation-delete' mode='sync'>
-<block atomic="true"><switch test='`$service-data.service-topology.service-topology-identifier.service-instance-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="404" />
- <parameter name="error-message" value="`'Service ' + $service-topology-operation-input.service-information.service-instance-id + ' is not found'`" />
-</return></outcome></switch><switch test='`$service-topology-operation-input.request-information.request-action`'>
-<outcome value='DeleteServiceInstance'>
-<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 'delete' then request-action must be 'DeleteServiceInstance'" />
-</return></outcome></switch><switch test='`$service-data.service-level-oper-status.order-status`'>
-<outcome value='PendingDelete'>
-<block atomic="true"></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="`'Order status is ' + $service-data.service-level-oper-status.order-status
- + ' but must be PendingDelete'`" />
-</return></outcome></switch><switch test='`$service-data.networks.network_length`'>
-<outcome value='0'>
-<block>
-</block></outcome><outcome value=''><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="Cannot delete the service because there are networks defined" />
-</return></outcome></switch><switch test='`$service-data.vnfs.vnf_length`'>
-<outcome value='0'>
-<block>
-</block></outcome><outcome value=''><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="Cannot delete the service because there are VNFs defined" />
-</return></outcome></switch><switch test='`$service-data.provided-allotted-resources.provided-allotted-resource_length`'>
-<outcome value='0'>
-<block>
-</block></outcome><outcome value=''><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="Cannot deactivate this service because there are provided allotted resources" />
-</return></outcome></switch><switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'>
-<outcome value='0'>
-<block>
-</block></outcome><outcome value=''><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="Cannot deactivate this service because there are consumed allotted resources" />
-</return></outcome></switch><set>
-<parameter name='service-data.' value='' />
-<parameter name='service-status.' value='' />
-</set></block></method></service-logic>
+<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='service-topology-operation-delete' mode='sync'>
+ <block atomic="true">
+ <switch test='`$service-data.service-topology.service-topology-identifier.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="`'Service ' + $service-topology-operation-input.service-information.service-instance-id + ' is not found'`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteServiceInstance'>
+ <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 'delete' then request-action must be 'DeleteServiceInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value=''>
+ <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="Cannot delete the service because there are networks defined" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value=''>
+ <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="Cannot delete the service because there are VNFs defined" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.provided-allotted-resources.provided-allotted-resource_length`'>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value=''>
+ <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="Cannot deactivate this service because there are provided allotted resources" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value=''>
+ <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="Cannot deactivate this service because there are consumed allotted resources" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='SERVICE' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$service-topology-operation-input.service-information.service-instance-id`' />
+ <parameter name='naming-policy-generate-name-input.query-parameter' value='`$service-data.service-topology.onap-model-information.model-uuid`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ <set>
+ <parameter name='service-data.' value='' />
+ <parameter name='service-status.' value='' />
+ </set>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation.xml
index 33672709..1cf77188 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation.xml
@@ -1,24 +1,41 @@
-<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='service-topology-operation' mode='sync'>
-<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='validate-service-input' mode='sync' >
-</call><set>
-<parameter name='service-data.sdnc-request-header.' value='`$service-topology-operation-input.sdnc-request-header.`' />
-<parameter name='service-data.request-information.' value='`$service-topology-operation-input.request-information.`' />
-<parameter name='service-data.service-information.' value='`$service-topology-operation-input.service-information.`' />
-<parameter name='service-data.service-request-input.' value='`$service-topology-operation-input.service-request-input.`' />
-</set><switch test='`$service-topology-operation-input.sdnc-request-header.svc-action`'>
-<outcome value='assign'>
-<call module='GENERIC-RESOURCE-API' rpc='service-topology-operation-assign' mode='sync' >
-</call></outcome><outcome value='deactivate'>
-<call module='GENERIC-RESOURCE-API' rpc='service-topology-operation-deactivate' mode='sync' >
-</call></outcome><outcome value='delete'>
-<call module='GENERIC-RESOURCE-API' rpc='service-topology-operation-delete' mode='sync' >
-</call></outcome><outcome value='Other'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="`$service-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
-</return></outcome></switch><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>
+<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='service-topology-operation' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-service-input' mode='sync' ></call>
+ <set>
+ <parameter name='service-data.sdnc-request-header.' value='`$service-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='service-data.request-information.' value='`$service-topology-operation-input.request-information.`' />
+ <parameter name='service-data.service-information.' value='`$service-topology-operation-input.service-information.`' />
+ <parameter name='service-data.service-request-input.' value='`$service-topology-operation-input.service-request-input.`' />
+ </set>
+ <switch test='`$service-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <call module='GENERIC-RESOURCE-API' rpc='service-topology-operation-assign' mode='sync' ></call>
+ </outcome>
+ <outcome value='deactivate'>
+ <call module='GENERIC-RESOURCE-API' rpc='service-topology-operation-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='delete'>
+ <call module='GENERIC-RESOURCE-API' rpc='service-topology-operation-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='changeassign'>
+ <call module='GENERIC-RESOURCE-API' rpc='service-topology-operation-changeassign' mode='sync' ></call>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$service-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
+ </return>
+ </outcome>
+ </switch>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-api-contrail-route-input.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-api-contrail-route-input.xml
new file mode 100644
index 00000000..bf041b1a
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-api-contrail-route-input.xml
@@ -0,0 +1,319 @@
+<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='validate-api-contrail-route-input' mode='sync'>
+ <block atomic="true">
+ <switch test='`$ctotmp.action`'>
+ <outcome value='create'>
+ <block atomic="true">
+ <switch test='`$cto-api.parent-service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.parent-service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.port-mirror-configuration-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.port-mirror-configuration-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.source-network-role`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.source-network-role is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.collector-network-role`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.collector-network-role is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.default-domain`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.default-domain is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.default-project`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.default-project is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.cloud-region-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.cloud-region-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.cloud-owner`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create:cto-api.cloud-owner is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.service-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create:cto-api.service-type is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.owning-entity`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create:cto-api.owning-entity is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='activate'>
+ <block atomic="true">
+ <switch test='`$cto-api.default-domain`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.default-domain is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.default-project`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.default-project is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.cloud-region-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.cloud-region-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.contrail-route-allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.src-contrail-network-fqdn is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.src-contrail-network-fqdn`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.src-contrail-network-fqdn is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.collector-contrail-network-fqdn`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.collector-contrail-network-fqdn is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.owning-entity`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create:cto-api.owning-entity is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='deactivate'>
+ <block atomic="true">
+ <switch test='`$cto-api.default-domain`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.default-domain is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.default-project`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.default-project is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.cloud-region-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.cloud-region-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.contrail-route-allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.src-contrail-network-fqdn is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.src-contrail-network-fqdn`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.src-contrail-network-fqdn is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.collector-contrail-network-fqdn`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.collector-contrail-network-fqdn is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.rollback-flag`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create:cto-api.rollback-flag is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.owning-entity`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create:cto-api.owning-entity is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='delete'>
+ <block atomic="true">
+ <switch test='`$cto-api.default-domain`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.default-domain is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.default-project`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.default-project is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.cloud-region-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.cloud-region-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.contrail-route-allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation:cto-api.src-contrail-network-fqdn is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.rollback-flag`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create:cto-api.rollback-flag is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.configuration-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create:cto-api.configuration-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$cto-api.owning-entity`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="API-contrail-route-topology-operation-create:cto-api.owning-entity is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-contrail-route-input.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-contrail-route-input.xml
index 7ab4bb93..421335d0 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-contrail-route-input.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-contrail-route-input.xml
@@ -1,162 +1,337 @@
-<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='validate-contrail-route-input' mode='sync'>
-<block atomic="true"><switch test='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
-</return></outcome></switch><switch test='`$contrail-route-topology-operation-input.sdnc-request-header.svc-request-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
-</return></outcome></switch><switch test='`$contrail-route-topology-operation-input.request-information.request-action`'>
-<outcome value='CreateContrailRouteInstance'><block>
-</block></outcome><outcome value='DeleteContrailRouteInstance'><block>
-</block></outcome><outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="request-information.request-action is a required input" />
-</return></outcome><outcome value='Other'><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Invalid request-information.request-action " />
-</return></outcome></switch><switch test='`$contrail-route-topology-operation-input.service-information.service-instance-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="service-information.service-instance-id is a required input" />
-</return></outcome></switch><switch test='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`'>
-<outcome value='assign'><block atomic="true"><switch test='`$contrail-route-topology-operation-input.request-information.request-action`'>
-<outcome value='CreateContrailRouteInstance'><block atomic="true"><switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
-</return></outcome></switch><switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-type`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="allotted-resource-information.allotted-resource-type is a required input" />
-</return></outcome></switch><switch test='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
-</return></outcome></switch><switch test='`$contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="contrail-route-information.onap-model-information.model-customization-uuid is a required input" />
-</return></outcome></switch><switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-id is a required input" />
-</return></outcome></switch><switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-role`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-role is a required input" />
-</return></outcome></switch><switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.dest-network.network-role`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="contrail-topology-operation-input.contrail-route-request-input.dest-network.network-role is a required input" />
-</return></outcome></switch><switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.contrail-applied-service-info.service-instance-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="contrail-route-topology-operation-input.contrail-route-request-input.contrail-applied-service-info.service-instance-id is a required input" />
-</return></outcome></switch><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key='SELECT * from ALLOTTED_RESOURCE_MODEL WHERE customization_uuid = $contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid'
- pfx='ar-model'>
-
-<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 allotted resource model found for model customization UUID ' + $contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" />
-</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="`'No allotted resource model found for model customization UUID ' + $contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" />
-</return></outcome></get-resource></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="request-information.request-action is a required to be CreateContrailRouteInstance for svc-action=assign" />
-</return></outcome></switch></block></outcome><outcome value='create'><block atomic="true"><switch test='`$contrail-route-topology-operation-input.request-information.request-action`'>
-<outcome value='CreateContrailRouteInstance'><block atomic="true"><switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
-</return></outcome></switch><switch test='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
-</return></outcome></switch></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="request-information.request-action is a required to be CreateNetworkInstance for svc-action=create" />
-</return></outcome></switch></block></outcome><outcome value='activate'><block atomic="true"><switch test='`$contrail-route-topology-operation-input.request-information.request-action`'>
-<outcome value='CreateContrailRouteInstance'><block atomic="true"><switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
-</return></outcome></switch><switch test='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
-</return></outcome></switch></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="request-information.request-action is a required to be CreateContrailRouteInstance for svc-action=activate" />
-</return></outcome></switch></block></outcome><outcome value='deactivate'><block atomic="true"><switch test='`$contrail-route-topology-operation-input.request-information.request-action`'>
-<outcome value='DeleteContrailRouteInstance'><block atomic="true"><switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
-</return></outcome></switch><switch test='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
-</return></outcome></switch></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="request-information.request-action is a required to be DeleteContrailRouteInstance for svc-action=deactivate" />
-</return></outcome></switch></block></outcome><outcome value='delete'><block atomic="true"><switch test='`$contrail-route-topology-operation-input.request-information.request-action`'>
-<outcome value='DeleteContrailRouteInstance'><block atomic="true"><switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
-</return></outcome></switch><switch test='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
-</return></outcome></switch></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="request-information.request-action is a required to be DeleteContrailRouteInstance for svc-action=delete" />
-</return></outcome></switch></block></outcome><outcome value='unassign'><block atomic="true"><switch test='`$contrail-route-topology-operation-input.request-information.request-action`'>
-<outcome value='DeleteContrailRouteInstance'><block atomic="true"><switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
-</return></outcome></switch></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="request-information.request-action is a required to be DeleteContrailRouteInstance for svc-action=unassign" />
-</return></outcome></switch></block></outcome></switch><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>
+<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='validate-contrail-route-input' mode='sync'>
+ <block atomic="true">
+ <switch test='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-route-topology-operation-input.sdnc-request-header.svc-request-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-route-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateContrailRouteInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='DeleteContrailRouteInstance'>
+ <block></block>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required input" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Invalid request-information.request-action " />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-route-topology-operation-input.service-information.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-route-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block atomic="true">
+ <switch test='`$contrail-route-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateContrailRouteInstance'>
+ <block atomic="true">
+ <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-type is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="contrail-route-information.onap-model-information.model-customization-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-role`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="contrail-route-topology-operation-input.contrail-route-request-input.source-network.network-role is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.dest-network.network-role`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="contrail-topology-operation-input.contrail-route-request-input.dest-network.network-role is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-route-topology-operation-input.contrail-route-request-input.contrail-applied-service-info.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="contrail-route-topology-operation-input.contrail-route-request-input.contrail-applied-service-info.service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from ALLOTTED_RESOURCE_MODEL WHERE customization_uuid = $contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid'
+ pfx='ar-model'>
+ <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 alloted resource model found for model customization UUID ' + $contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" />
+ </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="`'No alloted resource model found for model customization UUID ' + $contrail-route-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </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="request-information.request-action is a required to be CreateContrailRouteInstance for svc-action=assign" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='create'>
+ <block atomic="true">
+ <switch test='`$contrail-route-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateContrailRouteInstance'>
+ <block atomic="true">
+ <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </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="request-information.request-action is a required to be CreateNetworkInstance for svc-action=create" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='activate'>
+ <block atomic="true">
+ <switch test='`$contrail-route-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateContrailRouteInstance'>
+ <block atomic="true">
+ <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </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="request-information.request-action is a required to be CreateContrailRouteInstance for svc-action=activate" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='deactivate'>
+ <block atomic="true">
+ <switch test='`$contrail-route-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteContrailRouteInstance'>
+ <block atomic="true">
+ <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </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="request-information.request-action is a required to be DeleteContrailRouteInstance for svc-action=deactivate" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='delete'>
+ <block atomic="true">
+ <switch test='`$contrail-route-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteContrailRouteInstance'>
+ <block atomic="true">
+ <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </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="request-information.request-action is a required to be DeleteContrailRouteInstance for svc-action=delete" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='unassign'>
+ <block atomic="true">
+ <switch test='`$contrail-route-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteContrailRouteInstance'>
+ <block atomic="true">
+ <switch test='`$contrail-route-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </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="request-information.request-action is a required to be DeleteContrailRouteInstance for svc-action=unassign" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-generic-configuration-input.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-generic-configuration-input.xml
new file mode 100755
index 00000000..cc1bc1aa
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-generic-configuration-input.xml
@@ -0,0 +1,108 @@
+<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='validate-generic-configuration-input' mode='sync'>
+ <block atomic="true">
+ <switch test='`$service-data.service-information.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Service instance ' + $generic-configuration-topology-operation-input.service-information.service-instance-id + ' does not exist'`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generic-configuration-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generic-configuration-topology-operation-input.sdnc-request-header.svc-request-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generic-configuration-topology-operation-input.request-information.request-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$generic-configuration-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <switch test='`$generic-configuration-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateGenericConfigurationInstance'>
+ <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 ' + $generic-configuration-topology-operation-input.sdnc-request-header.svc-action + ' then request-action must be CreateGenericConfigurationInstance'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='activate'>
+ <switch test='`$generic-configuration-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateGenericConfigurationInstance'>
+ <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 ' + $generic-configuration-topology-operation-input.sdnc-request-header.svc-action + ' then request-action must be CreateGenericConfigurationInstance'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='deactivate'>
+ <switch test='`$generic-configuration-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteGenericConfigurationInstance'>
+ <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 ' + $generic-configuration-topology-operation-input.sdnc-request-header.svc-action + ' then request-action must be DeleteGenericConfigurationInstance'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='unassign'>
+ <switch test='`$generic-configuration-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteGenericConfigurationInstance'>
+ <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 ' + $generic-configuration-topology-operation-input.sdnc-request-header.svc-action + ' then request-action must be DeleteGenericConfigurationInstance'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unsupported svc-action ' + $generic-configuration-topology-operation-input.sdnc-request-header.svc-action`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-getpathsegment-input.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-getpathsegment-input.xml
new file mode 100755
index 00000000..34895442
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-getpathsegment-input.xml
@@ -0,0 +1,107 @@
+<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='validate-getpathsegment-input' mode='sync'>
+ <block atomic="true">
+ <switch test='`$getpathsegment-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$getpathsegment-topology-operation-input.sdnc-request-header.svc-request-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$getpathsegment-topology-operation-input.request-information.request-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.onap-model-information.model-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$getpathsegment-topology-operation-input.service-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.onap-model-information.model-invariant-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$getpathsegment-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='create'>
+ <block atomic="true">
+ <switch test='`$getpathsegment-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateForwardingPathInstance'>
+ <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="service-information.subscription-service-type is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from SERVICE_MODEL WHERE service_uuid = $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid'
+ pfx='db.service-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="System error reading SERVICE_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 service model found for service UUID ' + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from SERVICE_MODEL WHERE invariant_uuid = $getpathsegment-topology-operation-input.service-information.onap-model-information.model-invariant-uuid'
+ pfx='db.service-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="System error reading SERVICE_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 service model found for invariant UUID ' + $getpathsegment-topology-operation-input.service-information.onap-model-information.model-invariant-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-network-input.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-network-input.xml
index db1a73bb..3b300943 100644
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-network-input.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-network-input.xml
@@ -46,12 +46,16 @@
<outcome value='CreateNetworkInstance'>
<block atomic="true">
<switch test='`$network-topology-operation-input.network-information.network-id`'>
- <outcome value=''></outcome>
+ <outcome value=''>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </outcome>
<outcome value='Other'>
<block>
<switch test='`$service-data.networks.network_length`'>
<outcome value=''>
- <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
+ <record plugin="com.att.sdnctl.sli.recording.Slf4jRecorder">
<parameter name="logger" value="message-log"/>
<parameter name="field1" value="__TIMESTAMP__"/>
<parameter name="field2" value="GENERIC-RESOURCE-API.validate-network-input"/>
@@ -68,21 +72,51 @@
<block atomic="true">
<set>
<parameter name='tmp.nidx' value='`$nidx`' />
- <parameter name='ctx.network-data.' value='`$service-data.networks.network[$nidx].`' />
+ <parameter name='network-data.' value='`$service-data.networks.network[$nidx].`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.network-instance-group-id`'>
+ <outcome value=''>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <switch test='`$service-data.network-instance-groups.network-instance-group_length`'>
+ <outcome value=''>
+ <record plugin="com.att.sdnctl.sli.recording.Slf4jRecorder">
+ <parameter name="logger" value="message-log"/>
+ <parameter name="field1" value="__TIMESTAMP__"/>
+ <parameter name="field2" value="GENERIC-RESOURCE-API.validate-network-input"/>
+ <parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/>
+ <parameter name="field4" value="Network instance group id proveded but no network instance group exists that matches"/>
+ <parameter name="field5" value="`$network-topology-operation-input.network-information.network-instance-group-id`"/>
+ </record>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='ngidx' start='0' end='`$service-data.network-instance-groups.network-instance-_length`' >
+ <switch test="`$service-data.network-instance-groups.network-instance-group[$nidx].network-instance-group-id == $network-topology-operation-input.network-information.network-instance-group-id`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ngidx' value='`$ngidx`' />
+ <parameter name='ctx.network-instance-group-data.' value='`$service-data.network-instance-groups.network-instance-group[$ngidx].`' />
</set>
</block>
</outcome>
</switch>
</for>
- <switch test="`$tmp.nidx`">
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" />
- </return>
- </outcome>
- </switch>
</block>
</outcome>
</switch>
@@ -241,12 +275,6 @@
<outcome value='activate'>
<block atomic="true">
<switch test='`$network-topology-operation-input.request-information.request-action`'>
- <outcome value='ActivateSOTNConnectivityInstance'>
- <block atomic="true"></block>
- </outcome>
- <outcome value='ActivateDCINetworkInstance'>
- <block atomic="true"></block>
- </outcome>
<outcome value='CreateNetworkInstance'>
<block atomic="true">
<switch test='`$network-topology-operation-input.network-information.network-id`'>
@@ -407,15 +435,89 @@
</switch>
</block>
</outcome>
- <outcome value='deactivate'>
+ <outcome value='changeassign'>
<block atomic="true">
<switch test='`$network-topology-operation-input.request-information.request-action`'>
- <outcome value='DeactivateSOTNConnectivityInstance'>
- <block atomic="true"></block>
+ <outcome value='CreateNetworkInstance'>
+ <block atomic="true">
+ <switch test='`$network-topology-operation-input.network-information.network-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.network-information.network-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.from-preload`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-information.from-preload is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-information.onap-model-information.model-invariant-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-information.onap-model-information.model-customization-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-information.onap-model-information.model-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-request-input.tenant`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.tenant is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.network-request-input.aic-cloud-region`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.network-request-information.aic-cloud-region is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
</outcome>
- <outcome value='DeActivateDCINetworkInstance'>
- <block atomic="true"></block>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is required to be CreateNetworkInstance for svc-action=changeassign" />
+ </return>
</outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='deactivate'>
+ <block atomic="true">
+ <switch test='`$network-topology-operation-input.request-information.request-action`'>
<outcome value='DeleteNetworkInstance'>
<block atomic="true">
<switch test='`$network-topology-operation-input.network-information.network-id`'>
@@ -473,4 +575,4 @@
</return>
</block>
</method>
-</service-logic>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-security-zone-input.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-security-zone-input.xml
index 659a7939..0aaa7bae 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-security-zone-input.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-security-zone-input.xml
@@ -1,157 +1,328 @@
-<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='validate-security-zone-input' mode='sync'>
-<block atomic="true"><switch test='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
-</return></outcome></switch><switch test='`$security-zone-topology-operation-input.sdnc-request-header.svc-request-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
-</return></outcome></switch><switch test='`$security-zone-topology-operation-input.request-information.request-action`'>
-<outcome value='CreateSecurityZoneInstance'><block>
-</block></outcome><outcome value='DeleteSecurityZoneInstance'><block>
-</block></outcome><outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="request-information.request-action is a required input" />
-</return></outcome><outcome value='Other'><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Invalid request-information.request-action " />
-</return></outcome></switch><switch test='`$security-zone-topology-operation-input.service-information.service-instance-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="service-information.service-instance-id is a required input" />
-</return></outcome></switch><switch test='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`'>
-<outcome value='assign'><block atomic="true"><switch test='`$security-zone-topology-operation-input.request-information.request-action`'>
-<outcome value='CreateSecurityZoneInstance'><block atomic="true"><switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
-</return></outcome></switch><switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-type`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="allotted-resource-information.allotted-resource-type is a required input" />
-</return></outcome></switch><switch test='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
-</return></outcome></switch><switch test='`$security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="security-zone-information.onap-model-information.model-customization-uuid is a required input" />
-</return></outcome></switch><switch test='`$security-zone-topology-operation-input.security-zone-request-input.vlan-tag`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="security-zone-topology-operation-input.security-zone-request-input.vlan-tag is a required input" />
-</return></outcome></switch><switch test='`$security-zone-topology-operation-input.security-zone-request-input.trusted-network-role`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="security-zone-topology-operation-input.security-zone-request-input.trusted-network-role is a required input" />
-</return></outcome></switch><switch test='`$security-zone-topology-operation-input.security-zone-request-input.untrusted-network-role`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="security-zone-operation-input.security-zone-request-input.untrusted-network-role is a required input" />
-</return></outcome></switch><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key='SELECT * from ALLOTTED_RESOURCE_MODEL WHERE customization_uuid = $security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid'
- pfx='ar-model'>
-
-<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 allotted resource model found for model customization UUID ' + $security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" />
-</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="`'No allotted resource model found for model customization UUID ' + $security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" />
-</return></outcome></get-resource></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="request-information.request-action is a required to be CreateSecurityZoneInstance for svc-action=assign" />
-</return></outcome></switch></block></outcome><outcome value='create'><block atomic="true"><switch test='`$security-zone-topology-operation-input.request-information.request-action`'>
-<outcome value='CreateSecurityZoneInstance'><block atomic="true"><switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
-</return></outcome></switch><switch test='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
-</return></outcome></switch></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="request-information.request-action is a required to be CreateSecurityZoneInstance for svc-action=create" />
-</return></outcome></switch></block></outcome><outcome value='activate'><block atomic="true"><switch test='`$security-zone-topology-operation-input.request-information.request-action`'>
-<outcome value='CreateSecurityZoneInstance'><block atomic="true"><switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
-</return></outcome></switch><switch test='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
-</return></outcome></switch></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="request-information.request-action is a required to be CreateSecurityZoneInstance for svc-action=activate" />
-</return></outcome></switch></block></outcome><outcome value='deactivate'><block atomic="true"><switch test='`$security-zone-topology-operation-input.request-information.request-action`'>
-<outcome value='DeleteSecurityZoneInstance'><block atomic="true"><switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
-</return></outcome></switch><switch test='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
-</return></outcome></switch></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="request-information.request-action is a required to be DeleteSecurityZoneInstance for svc-action=deactivate" />
-</return></outcome></switch></block></outcome><outcome value='delete'><block atomic="true"><switch test='`$security-zone-topology-operation-input.request-information.request-action`'>
-<outcome value='DeleteSecurityZoneInstance'><block atomic="true"><switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
-</return></outcome></switch><switch test='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
-</return></outcome></switch></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="request-information.request-action is a required to be DeleteSecurityZoneInstance for svc-action=delete" />
-</return></outcome></switch></block></outcome><outcome value='unassign'><block atomic="true"><switch test='`$security-zone-topology-operation-input.request-information.request-action`'>
-<outcome value='DeleteSecurityZoneInstance'><block atomic="true"><switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
-</return></outcome></switch></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="request-information.request-action is a required to be DeleteSecurityZoneInstance for svc-action=unassign" />
-</return></outcome></switch></block></outcome></switch><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>
+<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='validate-security-zone-input' mode='sync'>
+ <block atomic="true">
+ <switch test='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$security-zone-topology-operation-input.sdnc-request-header.svc-request-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$security-zone-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateSecurityZoneInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='DeleteSecurityZoneInstance'>
+ <block></block>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required input" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Invalid request-information.request-action " />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$security-zone-topology-operation-input.service-information.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$security-zone-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block atomic="true">
+ <switch test='`$security-zone-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateSecurityZoneInstance'>
+ <block atomic="true">
+ <switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-type is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="security-zone-information.onap-model-information.model-customization-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$security-zone-topology-operation-input.security-zone-request-input.vlan-tag`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="security-zone-topology-operation-input.security-zone-request-input.vlan-tag is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$security-zone-topology-operation-input.security-zone-request-input.trusted-network-role`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="security-zone-topology-operation-input.security-zone-request-input.trusted-network-role is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$security-zone-topology-operation-input.security-zone-request-input.untrusted-network-role`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="security-zone-operation-input.security-zone-request-input.untrusted-network-role is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from ALLOTTED_RESOURCE_MODEL WHERE customization_uuid = $security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid'
+ pfx='ar-model'>
+ <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 alloted resource model found for model customization UUID ' + $security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" />
+ </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="`'No alloted resource model found for model customization UUID ' + $security-zone-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </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="request-information.request-action is a required to be CreateSecurityZoneInstance for svc-action=assign" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='create'>
+ <block atomic="true">
+ <switch test='`$security-zone-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateSecurityZoneInstance'>
+ <block atomic="true">
+ <switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </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="request-information.request-action is a required to be CreateSecurityZoneInstance for svc-action=create" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='activate'>
+ <block atomic="true">
+ <switch test='`$security-zone-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateSecurityZoneInstance'>
+ <block atomic="true">
+ <switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </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="request-information.request-action is a required to be CreateSecurityZoneInstance for svc-action=activate" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='deactivate'>
+ <block atomic="true">
+ <switch test='`$security-zone-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteSecurityZoneInstance'>
+ <block atomic="true">
+ <switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </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="request-information.request-action is a required to be DeleteSecurityZoneInstance for svc-action=deactivate" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='delete'>
+ <block atomic="true">
+ <switch test='`$security-zone-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteSecurityZoneInstance'>
+ <block atomic="true">
+ <switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$security-zone-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </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="request-information.request-action is a required to be DeleteSecurityZoneInstance for svc-action=delete" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='unassign'>
+ <block atomic="true">
+ <switch test='`$security-zone-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteSecurityZoneInstance'>
+ <block atomic="true">
+ <switch test='`$security-zone-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </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="request-information.request-action is a required to be DeleteSecurityZoneInstance for svc-action=unassign" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-service-input.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-service-input.xml
index 6b94ecba..ca1c3a46 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-service-input.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-service-input.xml
@@ -1,49 +1,117 @@
-<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='validate-service-input' mode='sync'>
-<block atomic="true"><switch test='`$service-topology-operation-input.sdnc-request-header.svc-action`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
-</return></outcome></switch><switch test='`$service-topology-operation-input.sdnc-request-header.svc-request-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
-</return></outcome></switch><switch test='`$service-topology-operation-input.request-information.request-action`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="request-information.request-action is a required input" />
-</return></outcome></switch><switch test='`$service-topology-operation-input.sdnc-request-header.svc-action`'>
-<outcome value='assign'>
-<block atomic="true"><switch test='`$service-topology-operation-input.service-information.service-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="service-information.service-id is a required input" />
-</return></outcome></switch><switch test='`$service-topology-operation-input.service-information.subscription-service-type`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="service-information.subscription-service-type is a required input" />
-</return></outcome></switch><switch test='`$service-topology-operation-input.service-information.global-customer-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="service-information.global-customer-id is a required input" />
-</return></outcome></switch><switch test='`$service-topology-operation-input.service-information.onap-model-information.model-invariant-uuid`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="service-information.onap-model-information.model-invariant-uuid is a required input" />
-</return></outcome></switch><switch test='`$service-topology-operation-input.service-information.onap-model-information.model-uuid`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="service-information.onap-model-information.model-uuid is a required input" />
-</return></outcome></switch><switch test='`$service-topology-operation-input.service-information.onap-model-information.model-name`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="service-information.onap-model-information.model-name is a required input" />
-</return></outcome></switch></block></outcome></switch></block></method></service-logic>
+<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='validate-service-input' mode='sync'>
+ <block atomic="true">
+ <switch test='`$service-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.sdnc-request-header.svc-request-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.request-information.request-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block atomic="true">
+ <switch test='`$service-topology-operation-input.service-information.subscription-service-type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.subscription-service-type is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.service-information.global-customer-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.global-customer-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.service-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.onap-model-information.model-invariant-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.service-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.onap-model-information.model-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.service-information.onap-model-information.model-name`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.onap-model-information.model-name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='changeassign'>
+ <block atomic="true">
+ <switch test='`$service-topology-operation-input.service-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.onap-model-information.model-invariant-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.service-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.onap-model-information.model-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-topology-operation-input.service-information.onap-model-information.model-name`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.onap-model-information.model-name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-vf-module-input.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-vf-module-input.xml
index e28fa147..fd660a94 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-vf-module-input.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-vf-module-input.xml
@@ -1,54 +1,106 @@
-<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='validate-vf-module-input' mode='sync'>
-<block atomic="true"><switch test='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
-</return></outcome></switch><switch test='`$vf-module-topology-operation-input.sdnc-request-header.svc-request-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
-</return></outcome></switch><switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="request-information.request-action is a required input" />
-</return></outcome></switch><switch test='`$vf-module-topology-operation-input.service-information.service-instance-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="service-information.service-instance-id is a required input" />
-</return></outcome></switch><switch test='`$vf-module-topology-operation-input.vnf-information.vnf-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="vnf-information.vnf-id is a required input" />
-</return></outcome></switch><switch test='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="vf-module-information.vf-module-id is a required input" />
-</return></outcome></switch><switch test='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`'>
-<outcome value='assign'>
-<block atomic="true"><switch test='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-name`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="vf-module-information.vf-module-request-input.vf-module-name is a required input" />
-</return></outcome></switch><switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="vf-module-information.onap-model-information.model-customization-uuid is a required input" />
-</return></outcome></switch><switch test='`$vf-module-topology-operation-input.vf-module-request-input.tenant`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="vf-module-information.vf-module-request-input.tenant is a required input" />
-</return></outcome></switch><switch test='`$vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="vf-module-request-input.aic-cloud-region is a required input" />
-</return></outcome></switch></block></outcome></switch></block></method></service-logic>
+<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='validate-vf-module-input' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.sdnc-request-header.svc-request-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.service-information.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vnf-information.vnf-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-information.vnf-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vf-module-information.vf-module-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vf-module-information.onap-model-information.model-customization-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-request-input.tenant`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vf-module-information.vf-module-request-input.tenant is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vf-module-request-input.aic-cloud-region is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='changeassign'>
+ <switch test='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vf-module-information.onap-model-information.model-customization-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-vnf-input.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-vnf-input.xml
index 744ab373..12d891d0 100644
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-vnf-input.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-vnf-input.xml
@@ -1,77 +1,99 @@
-<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='validate-vnf-input' mode='sync'>
- <block atomic="true">
- <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-action`'>
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
- </return>
- </outcome>
- </switch>
- <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-request-id`'>
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
- </return>
- </outcome>
- </switch>
- <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="request-information.request-action is a required input" />
- </return>
- </outcome>
- </switch>
- <switch test='`$vnf-topology-operation-input.service-information.service-instance-id`'>
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="service-information.service-instance-id is a required input" />
- </return>
- </outcome>
- </switch>
- <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-action`'>
- <outcome value='assign'>
- <block atomic="true">
- <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`'>
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="vnf-information.onap-model-information.model-customization-uuid is a required input" />
- </return>
- </outcome>
- </switch>
- <switch test='`$vnf-topology-operation-input.vnf-request-input.tenant`'>
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="vnf-information.vnf-request-input.tenant is a required input" />
- </return>
- </outcome>
- </switch>
- <switch test='`$vnf-topology-operation-input.vnf-request-input.aic-cloud-region`'>
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="vnf-request-input.aic-cloud-region is a required input" />
- </return>
- </outcome>
- </switch>
- </block>
- </outcome>
- </switch>
- </block>
- </method>
-</service-logic>
+<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='validate-vnf-input' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-request-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.service-information.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-information.vnf-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-information.vnf-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-information.onap-model-information.model-customization-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.tenant`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-information.vnf-request-input.tenant is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.aic-cloud-region`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-request-input.aic-cloud-region is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='changeassign'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-information.onap-model-information.model-customization-uuid is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-assign-rollback.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-assign-rollback.xml
new file mode 100755
index 00000000..edbbcca6
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-assign-rollback.xml
@@ -0,0 +1,188 @@
+<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-assign-rollback' mode='sync'>
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
+ <outcome value='1'>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.created-ipv4-flag`'>
+ <outcome value='true'>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.status' value="`'PENDING_DELETE_' + $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-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 = $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id" ></update>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="unassignIPAddress">
+ <parameter name="deleteEIPAM_status" value="`$tmp.status`" />
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='false'>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.created-ipv6-flag`'>
+ <outcome value='true'>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.status' value="`'PENDING_DELETE_' + $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-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 = $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id" ></update>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="unassignIPAddress">
+ <parameter name="deleteEIPAM_status" value="`$tmp.status`" />
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value=''>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.created-ipv6-flag`'>
+ <outcome value='true'>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.status' value="`'PENDING_DELETE_' + $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-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 = $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id" ></update>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="unassignIPAddress">
+ <parameter name="deleteEIPAM_status" value="`$tmp.status`" />
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.from-preload`'>
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='tmp.status' value="`'PENDING_DELETE_' + $vf-module-topology-operation-input.vf-module-information.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 = $vf-module-topology-operation-input.vf-module-information.vf-module-id" ></update>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="unassignIPAddress">
+ <parameter name="deleteEIPAM_status" value="`$tmp.status`" />
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].created_flag`'>
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name" ></delete>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' 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>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].created-flag`'>
+ <outcome value='true'>
+ <delete 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
+ AND related-to = l3-network
+ AND l3-network.network-id = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-id" ></delete>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.created-ipv4-flag`'>
+ <outcome value='true'>
+ <for silentFailure='true' index='ipv4-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv4-address-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv4-address-list.vip-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$ipv4-index]" ></delete>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.created-ipv6-flag`'>
+ <outcome value='true'>
+ <for silentFailure='true' index='ipv6-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv6-address-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv6-address-list.vip-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6[$ipv6-index]" ></delete>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <for index='nig-index' start='0' end='`$service-data.network-instance-groups.network-instance-group_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-id
+ == $service-data.network-instance-groups.network-instance-group[$nig-index].network-instance-group-id`'>
+ <outcome value='true'>
+ <for index='network-index' start='0' end='`$service-data.network-instance-groups.network-instance-group[$nig-index].networks.network_length`' >
+ <set>
+ <parameter name='service-data.network-instance-groups.network-instance-group[$nig-index].networks.network[$network-index].vlan-tag-id'
+ value='' />
+ <parameter name='service-data.network-instance-groups.network-instance-group[$nig-index].networks.network[$network-index].network-status'
+ value='unassigned' />
+ </set>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-activate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-activate.xml
index b9373071..d7f4ddd8 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-activate.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-activate.xml
@@ -1,108 +1,196 @@
-<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-activate' 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 'activate' then request-action must be 'CreateVfModuleInstance'" />
-</return></outcome></switch><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></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><set>
-<parameter name='vf-module-index' value='-1' />
-</set><switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_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 VF modules defined in MD-SAL for VNF ' + $vf-module-topology-operation-input.vnf-information.vnf-id`" />
-</return></outcome><outcome value='Other'>
-<for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
-<switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id == $vf-module-topology-operation-input.vf-module-information.vf-module-id`'>
-<outcome value='true'>
-<block>
-<set>
-<parameter name='vf-module-index' value='`$idx`' />
-</set><break></break></block></outcome></switch></for></outcome></switch><switch test='`$vf-module-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 VF module ID ' + $vf-module-topology-operation-input.vf-module-information.vf-module-id + ' in MD-SAL'`" />
-</return></outcome></switch><switch test='`$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`'>
-<outcome value='PendingCreate'>
-<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="`'Order status is ' + $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 + ' instead of PendingCreate'`" />
-</return></outcome></switch><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+<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-activate' mode='sync'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <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 'activate' then request-action must be 'CreateVfModuleInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <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>
+ <set>
+ <parameter name='vf-module-index' value='-1' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_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 VF modules defined in MD-SAL for VNF ' + $vf-module-topology-operation-input.vnf-information.vnf-id`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id == $vf-module-topology-operation-input.vf-module-information.vf-module-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vf-module-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-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 VF module ID ' + $vf-module-topology-operation-input.vf-module-information.vf-module-id + ' in MD-SAL'`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-vlan-tagging-activate' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ <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="orchestration-status" value="Active" />
-<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 vf-module in AAI" />
-</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 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></outcome></update><update resource='SQL' force='true' plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ <parameter name="orchestration-status" value="Active" />
+ <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 vf-module in AAI" />
+ </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 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>
+ </outcome>
+ </update>
+ <for silentFailure='true' index='vm-type-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="orchestration-status" value="Active" />
+ <parameter name="prov-status" value="NVTPROV" />
+ <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 vnfc in AAI" />
+ </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 vnfc found in AAI for vnfc name ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ </return>
+ </outcome>
+ </update>
+ </for>
+ </for>
+ <update resource='SQL' force='true' plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
key='UPDATE EIPAM_IP_ASSIGNMENTS SET status = "ACTIVE" WHERE info = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].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" />
-</return></outcome></update><set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.sdnc-request-header.'
+ <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" />
+ </return>
+ </outcome>
+ </update>
+ <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.'
+ <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.'
+ <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.'
+ <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.'
+ <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.'
+ <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'
+ </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='Created' />
-<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'
+ <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'
+ <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><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>
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vfmoduleactivate.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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-no-preload.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-no-preload.xml
new file mode 100755
index 00000000..fd1ca63b
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-no-preload.xml
@@ -0,0 +1,1302 @@
+<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-no-preload' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.from-preload' value='false' />
+ </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>
+ <switch test="$db.vfc-model.naming-policy">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'naming_policy is null 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`' />
+ <!-- Context variables used when creating vnfc object in AAI -->
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].invariant-uuid'
+ value='`$db.vfc-model.invariant-uuid`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-function'
+ value='`$db.vfc-model.nfc-function`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].uuid'
+ value='`$db.vfc-model.uuid`' />
+ </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>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_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='naming-policy-generate-name-input.policy-instance-name' value='`$db.vfc-model.naming-policy`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VM' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.query-parameter' value='`$db.vfc-model.customization-uuid`' />
+ <parameter name='naming-policy-generate-name-input.vnf-name' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-name`' />
+ <parameter name='naming-policy-generate-name-input.action' value='ASSIGN' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VM' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to generate VM name: ' + $error-message`" />
+ </return>
+ </block>
+ </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='`$naming-policy-generate-name-output.vm-name`' />
+ </set>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='naming-policy-generate-name-input.policy-instance-name' value='`$db.vfc-model.naming-policy`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.query-parameter' value='`$db.vf-module-to-vfc-mapping[$vm-type-index].vf-module-customization-uuid`' />
+ <parameter name='naming-policy-generate-name-input.action' value='ASSIGN' />
+ <parameter name='naming-policy-generate-name-input.vnf-name' value='`$vf-module-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.vm-name' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VM' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to generate VNFC name: ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vm-index].vnfc-name'
+ value='`$naming-policy-generate-name-output.vnfc-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'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VM' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <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>
+ </block>
+ </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'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VM' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <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>
+ </block>
+ </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='ipv4' />
+ <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='ipv6' />
+ <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>
+ </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='auto-ip-assignment-input.aic-cloud-region'
+ value='`$tmp.vf-module-topology.aic-cloud-region`' />
+ <parameter name='auto-ip-assignment-input.vf-module.model-customization-uuid'
+ value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`' />
+ <parameter name='auto-ip-assignment-input.vf-module-id'
+ value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='auto-ip-assignment-input.service-instance-id'
+ value='`$service-data.service-information.service-instance-id`' />
+ <parameter name='auto-ip-assignment-input.service-type'
+ value='`$service-data.service-information.service-type`' />
+ </set>
+ <set>
+ <parameter name='tmp.vnf-topology.vnf-assignments.vnf-vms_length'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' />
+ </set>
+ <for index='vm-type-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-type'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type`' />
+ <parameter name='tmp.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names_length'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' />
+ </set>
+ <for index='vm-name-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-name-index].vm-name'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-name-index]`' />
+ <parameter name='tmp.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-name-index].vnfc-names_length'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' />
+ </set>
+ <for index='vnfc-name-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <set>
+ <parameter name='tmp.vnf-topology.vnf-assignments.vnf-vms[$vm-type-index].vm-names[$vm-name-index].vnfc-names[$vnfc-name-index].vnfc-name'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-name`' />
+ </set>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ <set>
+ <parameter name='auto-ip-assignment-input.vnf-topology.vnf-assignments.'
+ value='tmp.vnf-topology.vnf-assignments.' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='auto-ip-assignment' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VM' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failure in call to auto-ip-assignment: ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </call>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-no-preload.log' />
+ </execute>
+ <for silentFailure='true' index='plan-index' start='0' end='`$eipam-ip-block.plans_length`' >
+ <for silentFailure='true' index='req-index' start='0' end='`$eipam-ip-block.plans[$plan-index].requests_length`' >
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
+ <parameter name='ctx_memory_result_key' value='ck-split' />
+ <parameter name='original_string' value='`$eipam-ip-block.plans[$plan-index].requests[$req-index].client-key`' />
+ <parameter name='regex' value='\|' />
+ </execute>
+ <set>
+ <parameter name='tmp.vm-type' value='`$ck-split[0]`' />
+ <parameter name='tmp.vnfc-name' value='`$ck-split[1]`' />
+ <parameter name='tmp.network-role' value='`$ck-split[2]`' />
+ <parameter name='tmp.subnet-role' value='`$ck-split[3]`' />
+ <parameter name='tmp.address-family' value='`$ck-split[5]`' />
+ <parameter name='tmp.ip-type' value='`$eipam-ip-block.plans[$plan-index].requests[$req-index].ip-type`' />
+ <parameter name='tmp.client-key' value='`$eipam-ip-block.plans[$plan-index].requests[$req-index].client-key`' />
+ <parameter name='tmp.ip-prefix' value='`$eipam-ip-block.plans[$plan-index].requests[$req-index].ip-prefix`' />
+ </set>
+ <switch test='`$tmp.subnet-role`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.subnet-role' value='NONE' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.address-family`'>
+ <outcome value='4'>
+ <set>
+ <parameter name='tmp.address-family' value='ipv4' />
+ </set>
+ </outcome>
+ <outcome value='6'>
+ <set>
+ <parameter name='tmp.address-family' value='ipv6' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='found-vm-type' value='false' />
+ </set>
+ <for index='vm-type-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ == $tmp.vm-type`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-vm-type' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-vm-type`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <block>
+ <block>
+ <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" ></update>
+ </block>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VM' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'EIPAM returned vm-type ' + $tmp.vm-type + ' but could not find that under vf-module-assignments'`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.ip-type`'>
+ <outcome value='FIXED'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-vnfc-name' value='false' />
+ </set>
+ <for silentFailure='true' index='vnfc-name-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-name
+ == $tmp.vnfc-name`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-vnfc-name' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-vnfc-name`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <block>
+ <block>
+ <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" ></update>
+ </block>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block>
+ <for silentFailure='true' index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VM' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'EIPAM returned VNFC name ' + $tmp.vnfc-name + ' but could not find that under vf-module-assignments for vm-type ' + $tmp.vm-type`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data_length`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data_length' value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-network-role'
+ value='`$tmp.network-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet_length' value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-subnet-role'
+ value='`$tmp.subnet-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments_length' value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-address-family'
+ value='`$tmp.address-family`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip_length' value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip[0].vnfc-ip-address'
+ value='`$tmp.ip-prefix`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip[0].vnfc-client-key'
+ value='`$tmp.client-key`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip[0].ip-type'
+ value='FIXED' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data_length' value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-network-role'
+ value='`$tmp.network-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet_length' value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-subnet-role'
+ value='`$tmp.subnet-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments_length' value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-address-family'
+ value='`$tmp.address-family`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip_length' value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip[0].vnfc-ip-address'
+ value='`$tmp.ip-prefix`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip[0].vnfc-client-key'
+ value='`$tmp.client-key`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[0].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip[0].ip-type'
+ value='FIXED' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-network-role' value='false' />
+ </set>
+ <for index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-network-role
+ == $tmp.network-role`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-network-role' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-network-role`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='network-role-index'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data_length`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-network-role'
+ value='`$tmp.network-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data_length'
+ value='`$network-role-index + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet_length' value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[0].vnfc-subnet-role'
+ value='`$tmp.subnet-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[0].vnfc-ip-assignments_length' value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-address-family'
+ value='`$tmp.address-family`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip_length' value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip[0].vnfc-ip-address'
+ value='`$tmp.ip-prefix`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip[0].vnfc-client-key'
+ value='`$tmp.client-key`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[0].vnfc-ip-assignments[0].vnfc-subnet-ip[0].ip-type'
+ value='FIXED' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-subnet-role' value='false' />
+ </set>
+ <for index='subnet-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-subnet-role
+ == $tmp.subnet-role`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-subnet-role' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-subnet-role`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='subnet-role-index'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet_length`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-subnet-role'
+ value='`$tmp.subnet-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet_length'
+ value='`$subnet-role-index + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments_length' value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[0].vnfc-address-family'
+ value='`$tmp.address-family`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[0].vnfc-subnet-ip_length' value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[0].vnfc-subnet-ip[0].vnfc-ip-address'
+ value='`$tmp.ip-prefix`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[0].vnfc-subnet-ip[0].vnfc-client-key'
+ value='`$tmp.client-key`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[0].vnfc-subnet-ip[0].ip-type'
+ value='FIXED' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-address-family' value='false' />
+ </set>
+ <for index='address-family-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-subnet-role
+ == $tmp.address-family`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-address-family' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-address-family`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='address-family-index'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments_length`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-address-family'
+ value='`$tmp.address-family`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments_length'
+ value='`$address-family-index + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length' value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[0].vnfc-ip-address'
+ value='`$tmp.ip-prefix`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[0].vnfc-client-key'
+ value='`$tmp.client-key`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[0].ip-type'
+ value='FIXED' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='ip-address-index'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$ip-address-index].vnfc-ip-address'
+ value='`$tmp.ip-prefix`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$ip-address-index].vnfc-client-key'
+ value='`$tmp.client-key`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$ip-address-index].ip-type'
+ value='FIXED' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-name-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length'
+ value='`$ip-address-length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='VIP'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.network-role' value='`$ck-split[1]`' />
+ <parameter name='tmp.subnet-role' value='`$ck-split[2]`' />
+ <parameter name='tmp.address-family' value='`$ck-split[4]`' />
+ </set>
+ <set>
+ <parameter name='tmp.vm-network-index' value='-1' />
+ </set>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='tmp.vm-network-index' value='0' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[0].network-role'
+ value='`$tmp.network-role`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='tmp.vm-network-index' value='0' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[0].network-role'
+ value='`$tmp.network-role`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for silentFailure='true' index='vm-network-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-role
+ == $tmp.network-role`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vm-network-index' value='`$vm-network-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.vm-network-index`'>
+ <outcome value='-1'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vm-network-index'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-role'
+ value='`$tmp.network-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length'
+ value='`$tmp.vm-network-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.address-family`'>
+ <outcome value='4'>
+ <block>
+ <set>
+ <parameter name='tmp.length'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v4_length`' />
+ </set>
+ <switch test='`$tmp.length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v4_length'
+ value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v4[0]'
+ value='`$tmp.ip-prefix`' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v4_length'
+ value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v4[0]'
+ value='`$tmp.ip-prefix`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$tmp.length]'
+ value='`$tmp.ip-prefix`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v4_length'
+ value='`$tmp.length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='6'>
+ <block>
+ <set>
+ <parameter name='tmp.length'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v6_length`' />
+ </set>
+ <switch test='`$tmp.length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v6_length'
+ value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v6[0]'
+ value='`$tmp.ip-prefix`' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v6_length'
+ value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v6[0]'
+ value='`$tmp.ip-prefix`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v6[$tmp.length]'
+ value='`$tmp.ip-prefix`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].floating-ips.floating-ip-v6_length'
+ value='`$tmp.length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-no-preload2.log' />
+ </execute>
+ <for silentFailure='true' index='vm-type-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <for silentFailure='true' index='vnfc-network-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.network-role'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-network-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vm-network-index' value='-1' />
+ </set>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='tmp.vm-network-index' value='0' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[0].network-role'
+ value='`$tmp.network-role`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='tmp.vm-network-index' value='0' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[0].network-role'
+ value='`$tmp.network-role`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for silentFailure='true' index='vm-network-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-role
+ == $tmp.network-role`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vm-network-index' value='`$vm-network-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.vm-network-index`'>
+ <outcome value='-1'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vm-network-index'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-role'
+ value='`$tmp.network-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length'
+ value='`$tmp.vm-network-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <for index='vnfc-subnet-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet_length`' >
+ <for index='address-family-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$vnfc-subnet-index].vnfc-ip-assignments_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.ip-version'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$vnfc-subnet-index].vnfc-ip-assignments[$address-family-index].vnfc-address-family`' />
+ </set>
+ <set>
+ <parameter name='tmp.nii-index' value='-1' />
+ </set>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item_length`'>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='tmp.nii-index' value='0' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item[0].ip-version'
+ value='`$tmp.ip-version`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='tmp.nii-index' value='0' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item[0].ip-version'
+ value='`$tmp.ip-version`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for silentFailure='true' index='nii-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-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[$vm-network-index].network-information-items.network-information-item[$nii-index].ip-version
+ == $tmp.ip-version`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.nii-index' value='`$nii-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.nii-index`'>
+ <outcome value='-1'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.nii-index'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item_length`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item[$tmp.nii-index].ip-version'
+ value='`$tmp.ip-version`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item_length'
+ value='`$tmp.nii-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item[$tmp.nii-index].network-ips.network-ip_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.ip-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='tmp.ip-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.ip-index'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item[$tmp.nii-index].network-ips.network-ip_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='ip-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$vnfc-subnet-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length`' >
+ <block>
+ <set>
+ <parameter name='target-index' value='`$ip-index + $tmp.ip-index`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item[$tmp.nii-index].network-ips.network-ip[$target-index]'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$vnfc-subnet-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$ip-index].vnfc-ip-address`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item[$tmp.nii-index].network-ips.network-ip_length'
+ value='`$tmp.ip-index + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$vnfc-subnet-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$tmp.vm-network-index].network-information-items.network-information-item[$tmp.nii-index].ip-count'
+ value='`$tmp.ip-index + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$vnfc-subnet-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length`' />
+ </set>
+ </block>
+ </for>
+ </for>
+ </block>
+ </for>
+ </for>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-no-preload3.log' />
+ </execute>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-preload.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-preload.xml
new file mode 100755
index 00000000..879f0008
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-preload.xml
@@ -0,0 +1,559 @@
+<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-preload' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.from-preload' value='true' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.'
+ value='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vf-module-topology.`' />
+ </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>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='db-vm-type-index' value='-1' />
+ </set>
+ <for index='tmp-idx' start='0' end='`$db.vf-module-to-vfc-mapping_length`' >
+ <switch test='`$db.vf-module-to-vfc-mapping[$tmp-idx].vm-type
+ == $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='db-vm-type-index' value='`$tmp-idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$db-vm-type-index`'>
+ <outcome value='-1'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Preload data contains vm-type ' + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type + ' but VF_MODULE_TO_VFC_MAPPING table does not have this vm-type'`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <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'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <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>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <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>
+ </block>
+ </outcome>
+ </get-resource>
+ <set>
+ <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].nfc-function'
+ value='`$db.vfc-model.nfc-function`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].invariant-uuid'
+ value='`$db.vfc-model.invariant-uuid`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].uuid'
+ value='`$db.vfc-model.uuid`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-count`' />
+ </set>
+ <switch test='`$db.vfc-model.naming-policy`'>
+ <outcome value=''>
+ <for index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-count`' >
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vm-index].vnfc-name'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-type-index]`' />
+ </set>
+ </for>
+ </outcome>
+ <outcome value='Other'>
+ <for index='vm-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-count`' >
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.policy-instance-name' value='`$db.vfc-model.naming-policy`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.query-parameter' value='`$db.vf-module-to-vfc-mapping[$vm-type-index].vf-module-customization-uuid`' />
+ <parameter name='naming-policy-generate-name-input.action' value='ASSIGN' />
+ <parameter name='naming-policy-generate-name-input.vnf-name' value='`$vf-module-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.vm-name' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vm-name[$vm-index]`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to generate VNFC name: ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vm-index].vnfc-name'
+ value='`$naming-policy-generate-name-output.vnfc-name`' />
+ </set>
+ </outcome>
+ </call>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' />
+ </set>
+ <for silentFailure='true' index='vm-network-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vm-network-index].vnfc-network-role'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vm-network-index].vnfc-subnet[0].vnfc-subnet-role'
+ value='NA' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vm-network-index].vnfc-subnet_length'
+ value='1' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vm-network-index].vnfc-subnet[0].vnfc-ip-assignments_length'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-information-items.network-information-item_length`' />
+ </set>
+ <for silentFailure='true' index='ip-version-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-information-items.network-information-item_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vm-network-index].vnfc-subnet[0].vnfc-ip-assignments[$ip-version-index].vnfc-address-family'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-information-items.network-information-item[$ip-version-index].ip-version`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vm-network-index].vnfc-subnet[0].vnfc-ip-assignments[$ip-version-index].vnfc-subnet-dhcp'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-information-items.network-information-item[$ip-version-index].use-dhcp`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vm-network-index].vnfc-subnet[0].vnfc-ip-assignments[$ip-version-index].vnfc-subnet-ip-count'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-information-items.network-information-item[$ip-version-index].ip-count`' />
+ </set>
+ <for silentFailure='true' index='ip-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-information-items.network-information-item[$ip-version-index].network-ips.network-ip_length`' >
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vm-network-index].vnfc-subnet[0].vnfc-ip-assignments[$ip-version-index].vnfc-subnet-ips[$ip-index].vnfc-ip-address'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-information-items.network-information-item[$ip-version-index].network-ips.network-ip[$ip-index]`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vm-network-index].vnfc-subnet[0].vnfc-ip-assignments[$ip-version-index].vnfc-subnet-ips[$ip-index].ip-type'
+ value='FIXED' />
+ </set>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-preload-x.log' />
+ </execute>
+ <for silentFailure='true' index='vnf-network-index' start='0'
+ end='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='found-network-name' value='false' />
+ </set>
+ <for silentFailure='true' index='ex-vnf-network-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <switch test='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-name
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].network-name`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-network-name' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-network-name`'>
+ <outcome value='true'>
+ <switch test='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].network-role`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='cur-vnf-network-index'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].network-role'
+ value='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].network-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].network-name`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].network-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].network-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].neutron-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].neutron-id`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length'
+ value='`$cur-vnf-network-index + 1`' />
+ </set>
+ <set>
+ <parameter name='cur-subnet-index' value='0' />
+ </set>
+ <switch test="`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[0].sdnc-subnet-id`">
+ <outcome value=''>
+ <block atomic="true">
+ <for index='ex-subnet-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data_length`' >
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].sdnc-subnet-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].sdnc-subnet-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].subnet-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].subnet-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].ip-version'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].ip-version`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].subnet-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].subnet-name`' />
+ </set>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data_length'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data_length`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='subnet-index' start='0'
+ end='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.found-match' value='false' />
+ </set>
+ <for index='ex-subnet-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data_length`' >
+ <switch test='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-index].ip-version
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].ip-version`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='match' value='true' />
+ </set>
+ <switch test='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-index].subnet-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-index].subnet-id
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].subnet-id`'>
+ <outcome value='false'>
+ <set>
+ <parameter name='match' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-index].subnet-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-index].subnet-name
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].subnet-name`'>
+ <outcome value='false'>
+ <set>
+ <parameter name='match' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test='`$match`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.found-match' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.found-match`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-preloadxxx.log' />
+ </execute>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Could not find subnet match for network-name '
+ + $mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-name`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data[$cur-subnet-index].sdnc-subnet-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].sdnc-subnet-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data[$cur-subnet-index].subnet-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].subnet-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data[$cur-subnet-index].ip-version'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].ip-version`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data[$cur-subnet-index].subnet-name'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$ex-vnf-network-index].subnets-data.subnet-data[$ex-subnet-index].subnet-name`' />
+ </set>
+ <set>
+ <parameter name='cur-subnet-index' value='`$cur-subnet-index + 1`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].subnets-data.subnet-data_length'
+ value='`$cur-subnet-index`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='cur-vnf-network-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='cur-vnf-network-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='cur-vnf-network-index'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].network-role'
+ value='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].network-name'
+ value='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-name`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].network-id'
+ value='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$cur-vnf-network-index].neutron-id'
+ value='`$mdsal-preload.preload-list[0].preload-data.preload-vf-module-topology-information.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].neutron-id`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length'
+ value='`$cur-vnf-network-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-preload.log' />
+ </execute>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for index='vm-network-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='found-network' value='false' />
+ </set>
+ <set>
+ <parameter name='tmp.network-role'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-role`' />
+ </set>
+ <for index='vnf-network-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role
+ == $tmp.network-role`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-id`' />
+ </set>
+ <set>
+ <parameter name='found-network' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-network`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNFC' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Unable to find network-id for network with network-role ' + $tmp.network-role`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </for>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-assign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-assign.xml
index 143c39a4..c68737e4 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-assign.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-assign.xml
@@ -1,414 +1,602 @@
-<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'
+<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">
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <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></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
+ <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>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.exist.sdnc-model-name' value='false' />
+ <parameter name='tmp.exist.vf_module_label' value='false' />
+ </set>
+ <switch test="`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param_length`">
+ <outcome value=''>
+ <set>
+ <parameter name='vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='p' start='0' end='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param_length`' >
+ <switch test="`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$p].name`">
+ <outcome value='sdnc_model_name'>
+ <set>
+ <parameter name='tmp.exist.sdnc-model-name' value='true' />
+ </set>
+ </outcome>
+ <outcome value='vf_module_label'>
+ <set>
+ <parameter name='tmp.exist.vf_module_label' value='true' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ <switch test="`$tmp.exist.sdnc-model-name == 'true' and $tmp.exist.vf_module_label == 'true'`">
+ <outcome value='true'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vf-module-assign' 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="`'Failed to create self-serve assignment for vf-module with vf-module-id=' + $vf-module-topology-operation-input.vf-module-information.vf-module-id`" />
+ </return>
+ </outcome>
+ </call>
+ <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/ss-vnfend.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>
+ </outcome>
+ <outcome value='false'>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT sdnc_model_name from VF_MODEL
+ WHERE customization_uuid = $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.onap-model-information.model-customization-uuid
+ AND sdnc_model_name is not null'
+ pfx='db.vf-model-name'>
+ <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_MODEL table" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT vf_module_label from VF_MODULE_MODEL
+ WHERE vf_customization_uuid = $vf-module-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid
+ AND vf_module_label is not null '
+ pfx='db.vf-module-label'>
+ <outcome value='success'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vf-module-assign' 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="`'Failed to create self-serve assignment for vf-module with vf-module-id=' + $vf-module-topology-operation-input.vf-module-information.vf-module-id`" />
+ </return>
+ </outcome>
+ </call>
+ <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/ss-vnfend.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>
+ </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 reading VF_MODULE_MODEL table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-name`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vf-module-information.vf-module-request-input.vf-module-name is a required input" />
+ </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'
+ </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"
+ </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
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner 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'
+ <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></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'
+ </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'
+ </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'
+ </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'
+ </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'
+ </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'
+ </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'
+ </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'
+ </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'
+ </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.'
+ </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-data.vnf-topology.vnf-topology-identifier-structure.vnf-name + $db.vfc-model.nfc-naming-code`" />
-<parameter name='generate-unique-name-input.index-length' value='3' />
-
-<!--
-<parameter name='generate-unique-name-input.prefix' value="`$service-data.vnfs.vnf[$vnf-index].vnf-name + $db.vfc-model.nfc-naming-code`" />
--->
-</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></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 &gt; $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 &gt; 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'
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value="`$prop.controller.url + $prop.restapi.preloadinformation + $vf-module-topology-operation-input.vf-module-request-input.vf-module-name + '/vf-module'`" />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-preload" />
+ <outcome value='failure'>
+ <block>
+ <switch test='`$mdsal-preload.response-code`'>
+ <outcome value='404'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-no-preload' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving preload-information" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-preload' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </execute>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block atomic="true">
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <for silentFailure='true' index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.network-role' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-network-role`' />
+ </set>
+ <set>
+ <parameter name='found-network-role' value='false' />
+ </set>
+ <for index='vnf-network-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <switch test='`$tmp.network-role
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-network-role' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-network-role`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Cannot find VNF network role ' + $tmp.network-role`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].network-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-id`' />
+ </set>
+ <for index='subnet-role-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet_length`' >
+ <for index='address-family-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.address-family'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-address-family`' />
+ <parameter name='tmp.subnet-role'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-subnet-role`' />
+ </set>
+ <set>
+ <parameter name='found-subnet' value='false' />
+ </set>
+ <for silentFailure='true' index='vnf-address-family-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data_length`' >
+ <switch test='`$tmp.address-family
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$vnf-address-family-index].ip-version`'>
+ <outcome value='true'>
+ <switch test='`$tmp.subnet-role
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$vnf-address-family-index].subnet-role`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-subnet' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-subnet`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Cannot find VNF address family '
+ + $tmp.address-family
+ + ' for subnet role '
+ + $tmp.subnet-role`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].subnet-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$vnf-address-family-index].sdnc-subnet-id`' />
+ </set>
+ </block>
+ </for>
+ </for>
+ </block>
+ </for>
+ </for>
+ <for silentFailure='true' index='vm-network-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.network-role' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-role`' />
+ </set>
+ <for index='vnf-network-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <switch test='`$tmp.network-role
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4_length &gt; 0`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.address-family' value='ipv4' />
+ </set>
+ <set>
+ <parameter name='found-address-family' value='false' />
+ </set>
+ <for silentFailure='true' index='vnf-address-family-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data_length`' >
+ <switch test='`$tmp.address-family
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$vnf-address-family-index].ip-version`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-address-family' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-address-family`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Cannot find VNF address family '
+ + $tmp.address-family
+ + ' for network role '
+ + $tmp.network-role`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.ipv4-subnet-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$vnf-address-family-index].sdnc-subnet-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6_length &gt; 0`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.address-family' value='ipv6' />
+ </set>
+ <set>
+ <parameter name='found-address-family' value='false' />
+ </set>
+ <for silentFailure='true' index='vnf-address-family-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data_length`' >
+ <switch test='`$tmp.address-family
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$vnf-address-family-index].ip-version`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-address-family' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-address-family`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Cannot find VNF address family '
+ + $tmp.address-family
+ + ' for network role '
+ + $tmp.network-role`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.ipv6-subnet-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$vnf-address-family-index].sdnc-subnet-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vfmoduleb.log' />
+ </execute>
+ <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/'
@@ -416,162 +604,942 @@
+ '/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"
+ </set>
+ <switch test='`$from-preload`'>
+ <outcome value='false'>
+ <set>
+ <parameter name='automated-assignment' value='true' />
+ </set>
+ </outcome>
+ <outcome value='true'>
+ <set>
+ <parameter name='automated-assignment' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <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 &gt; 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 &gt; 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"
+ <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`" />
+ <parameter name="automated-assignment" value="`$automated-assignment`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <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">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <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 silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block atomic="true">
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name" >
+ <parameter name="vnfc-name" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ <parameter name="nfc-naming-code" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-naming-code`" />
+ <parameter name="nfc-function" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-function`" />
+ <parameter name="model-invariant-id" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].invariant-uuid`" />
+ <parameter name="model-version-id" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].uuid`" />
+ <parameter name="orchestration-status" value="`PendingCreate`" />
+ <parameter name="prov-status" value="`PREPROV`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error saving vnfc to AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error saving vnfc to AAI" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].created_flag' value='true' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc:relationship-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/generic-vnfs/generic-vnf/' +
+ $vf-module-topology-operation-input.vnf-information.vnf-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="vf-module" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/generic-vnfs/generic-vnf/' +
+ $vf-module-topology-operation-input.vnf-information.vnf-id +
+ '/vf-modules/vf-module/' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vnfc relationships in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating vnfc relationships" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <for silentFailure='true' index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='subnet-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet_length`' >
+ <for silentFailure='true' index='address-family-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.address-family'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-address-family`' />
+ </set>
+ <for silentFailure='true' index='address-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length`' >
+ <switch test='`$tmp.address-family`'>
+ <outcome value='ipv4'>
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv4-address-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND l3-interface-ipv4-address-list.l3-interface-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address" >
+ <parameter name="l3-interface-ipv4-address" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address`" />
+ <parameter name="l3-interface-ipv4-prefix-length" value="32" />
+ <parameter name="is-floating" value="false" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error creating l3-interface-ipv4-address-list object in AAI" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv4-address-list:relationship-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND l3-interface-ipv4-address-list.l3-interface-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].network-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="subnet" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].network-id +
+ '/subnets/subnet/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].subnet-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating l3-interface-ipv4-address-list relationships in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating l3-interface-ipv4-address-list relationships" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='ipv6'>
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv6-address-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND l3-interface-ipv6-address-list.l3-interface-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address" >
+ <parameter name="l3-interface-ipv6-address" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address`" />
+ <parameter name="l3-interface-ipv6-prefix-length" value="128" />
+ <parameter name="is-floating" value="false" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error creating l3-interface-ipv6-address-list object in AAI" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv6-address-list:relationship-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND l3-interface-ipv6-address-list.l3-interface-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].network-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="subnet" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].network-id +
+ '/subnets/subnet/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].subnet-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating l3-interface-ipv6-address-list relationships in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating l3-interface-ipv6-address-list relationships" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </for>
+ </for>
+ </block>
+ </for>
+ <for silentFailure='true' 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">
+ <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 &gt; 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 &gt; 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'
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $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">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <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">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No l3-network found in AAI for network ID '
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-id`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].created-flag' value='true' />
+ </set>
+ <for silentFailure='true' index='ipv4-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv4-address-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv4-address-list.vip-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$ipv4-index]" >
+ <parameter name="vip-ipv4-address" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$ipv4-index]`" />
+ <parameter name="vip-ipv4-prefix-length" value="32" />
+ <parameter name="is-floating" value="false" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error saving vip-ipv4-address-list in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error saving vip-ipv4-address-list" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.created-ipv4-flag' value='true' />
+ </set>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv4-address-list:relationship-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv4-address-list.vip-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$ipv4-index]"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="subnet" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-id
+ + '/subnets/subnet/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.ipv4-subnet-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="vnfc" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/vnfcs/vnfc/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vip-ipv4-address-list relationships in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating vip-ipv4-address-list relationships" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </for>
+ </block>
+ </for>
+ <for silentFailure='true' index='ipv6-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv6-address-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv6-address-list.vip-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6[$ipv6-index]" >
+ <parameter name="vip-ipv6-address" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6[$ipv6-index]`" />
+ <parameter name="vip-ipv6-prefix-length" value="128" />
+ <parameter name="is-floating" value="false" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error saving vip-ipv6-address-list in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error saving vip-ipv6-address-list" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.created-ipv6-flag' value='true' />
+ </set>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv6-address-list:relationship-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv6-address-list.vip-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6[$ipv6-index]"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="subnet" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-id
+ + '/subnets/subnet/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.ipv6-subnet-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="vnfc" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/vnfcs/vnfc/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vip-ipv6-address-list relationships in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating vip-ipv6-address-list relationships" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-vlan-tagging-assign' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vlantaggingfailure.log' />
+ </execute>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </call>
+ <for silentFailure='true' 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.'
+ 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 , $prop.cloud-region.cloud-owner )" >
+ <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.'
+ <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.'
+ <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.'
+ <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.'
+ <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.'
+ <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><call module='GENERIC-RESOURCE-API' rpc='gw-vfmodule-update' mode='sync' >
-</call><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'
+ </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'
+ <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'
+ <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><set>
-<parameter name='service-object-path'
+ </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>
+ </block>
+ </outcome>
+ </get-resource>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-name`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vf-module-information.vf-module-request-input.vf-module-name is a required input" />
+ </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 = $prop.cloud-region.cloud-owner 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>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value="`$prop.controller.url + $prop.restapi.preloadinformation + $vf-module-topology-operation-input.vf-module-request-input.vf-module-name + '/vf-module'`" />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-preload" />
+ <outcome value='failure'>
+ <block>
+ <switch test='`$mdsal-preload.response-code`'>
+ <outcome value='404'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-no-preload' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving preload-information" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-preload' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </execute>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block atomic="true">
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <for silentFailure='true' index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.network-role' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-network-role`' />
+ </set>
+ <set>
+ <parameter name='found-network-role' value='false' />
+ </set>
+ <for index='vnf-network-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <switch test='`$tmp.network-role
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-network-role' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-network-role`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Cannot find VNF network role ' + $tmp.network-role`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].network-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-id`' />
+ </set>
+ <for index='subnet-role-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet_length`' >
+ <for index='address-family-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.address-family'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-address-family`' />
+ <parameter name='tmp.subnet-role'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-subnet-role`' />
+ </set>
+ <set>
+ <parameter name='found-subnet' value='false' />
+ </set>
+ <for silentFailure='true' index='vnf-address-family-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data_length`' >
+ <switch test='`$tmp.address-family
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$vnf-address-family-index].ip-version`'>
+ <outcome value='true'>
+ <switch test='`$tmp.subnet-role
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$vnf-address-family-index].subnet-role`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-subnet' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-subnet`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Cannot find VNF address family '
+ + $tmp.address-family
+ + ' for subnet role '
+ + $tmp.subnet-role`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].subnet-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$vnf-address-family-index].sdnc-subnet-id`' />
+ </set>
+ </block>
+ </for>
+ </for>
+ </block>
+ </for>
+ </for>
+ <for silentFailure='true' index='vm-network-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.network-role' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-role`' />
+ </set>
+ <for index='vnf-network-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <switch test='`$tmp.network-role
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].network-role`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4_length &gt; 0`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.address-family' value='ipv4' />
+ </set>
+ <set>
+ <parameter name='found-address-family' value='false' />
+ </set>
+ <for silentFailure='true' index='vnf-address-family-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data_length`' >
+ <switch test='`$tmp.address-family
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$vnf-address-family-index].ip-version`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-address-family' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-address-family`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Cannot find VNF address family '
+ + $tmp.address-family
+ + ' for network role '
+ + $tmp.network-role`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.ipv4-subnet-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$vnf-address-family-index].sdnc-subnet-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6_length &gt; 0`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.address-family' value='ipv6' />
+ </set>
+ <set>
+ <parameter name='found-address-family' value='false' />
+ </set>
+ <for silentFailure='true' index='vnf-address-family-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data_length`' >
+ <switch test='`$tmp.address-family
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$vnf-address-family-index].ip-version`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-address-family' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-address-family`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Cannot find VNF address family '
+ + $tmp.address-family
+ + ' for network role '
+ + $tmp.network-role`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.ipv6-subnet-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$vnf-address-family-index].sdnc-subnet-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vfmoduleb.log' />
+ </execute>
+ <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/'
@@ -579,13 +1547,530 @@ key="INSERT INTO VIPR_CONFIGURATION (vnf_id, vnf_name, ecomp_service_instance_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/'`"/>
-<!--
-<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
- + $service-data.service-topology.service-topology-identifier.service-instance-id
- + '/service-data/service-topology/'`"/>
- -->
-</set><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>
+ </set>
+ <switch test='`$from-preload`'>
+ <outcome value='false'>
+ <set>
+ <parameter name='automated-assignment' value='true' />
+ </set>
+ </outcome>
+ <outcome value='true'>
+ <set>
+ <parameter name='automated-assignment' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <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`" />
+ <parameter name="automated-assignment" value="`$automated-assignment`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <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">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <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 silentFailure='true' index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <block atomic="true">
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name" >
+ <parameter name="vnfc-name" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ <parameter name="nfc-naming-code" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-naming-code`" />
+ <parameter name="nfc-function" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].nfc-function`" />
+ <parameter name="model-invariant-id" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].invariant-uuid`" />
+ <parameter name="model-version-id" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].uuid`" />
+ <parameter name="orchestration-status" value="`PendingCreate`" />
+ <parameter name="prov-status" value="`PREPROV`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error saving vnfc to AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error saving vnfc to AAI" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].created_flag' value='true' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc:relationship-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/generic-vnfs/generic-vnf/' +
+ $vf-module-topology-operation-input.vnf-information.vnf-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="vf-module" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/generic-vnfs/generic-vnf/' +
+ $vf-module-topology-operation-input.vnf-information.vnf-id +
+ '/vf-modules/vf-module/' +
+ $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vnfc relationships in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating vnfc relationships" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <for silentFailure='true' index='network-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <for silentFailure='true' index='subnet-role-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet_length`' >
+ <for silentFailure='true' index='address-family-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.address-family'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-address-family`' />
+ </set>
+ <for silentFailure='true' index='address-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length`' >
+ <switch test='`$tmp.address-family`'>
+ <outcome value='ipv4'>
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv4-address-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND l3-interface-ipv4-address-list.l3-interface-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address" >
+ <parameter name="l3-interface-ipv4-address" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address`" />
+ <parameter name="l3-interface-ipv4-prefix-length" value="32" />
+ <parameter name="is-floating" value="false" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error creating l3-interface-ipv4-address-list object in AAI" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv4-address-list:relationship-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND l3-interface-ipv4-address-list.l3-interface-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].network-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="subnet" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].network-id +
+ '/subnets/subnet/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].subnet-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating l3-interface-ipv4-address-list relationships in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating l3-interface-ipv4-address-list relationships" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ <outcome value='ipv6'>
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv6-address-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND l3-interface-ipv6-address-list.l3-interface-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address" >
+ <parameter name="l3-interface-ipv6-address" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address`" />
+ <parameter name="l3-interface-ipv6-prefix-length" value="128" />
+ <parameter name="is-floating" value="false" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error creating l3-interface-ipv6-address-list object in AAI" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-interface-ipv6-address-list:relationship-list"
+ key="vnfc.vnfc-name = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name
+ AND l3-interface-ipv6-address-list.l3-interface-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[$address-index].vnfc-ip-address"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="l3-network" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].network-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="subnet" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].network-id +
+ '/subnets/subnet/' +
+ $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$network-role-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].subnet-id`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating l3-interface-ipv6-address-list relationships in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating l3-interface-ipv6-address-list relationships" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </for>
+ </for>
+ </block>
+ </for>
+ <for silentFailure='true' 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">
+ <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].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/' +
+ $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">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <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">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No l3-network found in AAI for network ID '
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-id`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].created-flag' value='true' />
+ </set>
+ <for silentFailure='true' index='ipv4-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv4-address-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv4-address-list.vip-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$ipv4-index]" >
+ <parameter name="vip-ipv4-address" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$ipv4-index]`" />
+ <parameter name="vip-ipv4-prefix-length" value="32" />
+ <parameter name="is-floating" value="false" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error saving vip-ipv4-address-list in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error saving vip-ipv4-address-list" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.created-ipv4-flag' value='true' />
+ </set>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv4-address-list:relationship-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv4-address-list.vip-ipv4-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v4[$ipv4-index]"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="subnet" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-id
+ + '/subnets/subnet/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.ipv4-subnet-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="vnfc" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/vnfcs/vnfc/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vip-ipv4-address-list relationships in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating vip-ipv4-address-list relationships" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </for>
+ </block>
+ </for>
+ <for silentFailure='true' index='ipv6-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv6-address-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv6-address-list.vip-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6[$ipv6-index]" >
+ <parameter name="vip-ipv6-address" value="`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6[$ipv6-index]`" />
+ <parameter name="vip-ipv6-prefix-length" value="128" />
+ <parameter name="is-floating" value="false" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error saving vip-ipv6-address-list in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error saving vip-ipv6-address-list" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.created-ipv6-flag' value='true' />
+ </set>
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vip-ipv6-address-list:relationship-list"
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner
+ AND cloud-region.cloud-region-id = $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region
+ AND vip-ipv6-address-list.vip-ipv6-address = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.floating-ip-v6[$ipv6-index]"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="subnet" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/l3-networks/l3-network/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].network-id
+ + '/subnets/subnet/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$vm-network-index].floating-ips.ipv6-subnet-id`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="vnfc" />
+ <parameter name="relationship-list.relationship[1].related-link"
+ value="`'/aai/v$/network/vnfcs/vnfc/'
+ + $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating vip-ipv6-address-list relationships in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Not-found error updating vip-ipv6-address-list relationships" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ </block>
+ </for>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-vlan-tagging-assign' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vlantaggingfailure.log' />
+ </execute>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </call>
+ <for silentFailure='true' 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 , $prop.cloud-region.cloud-owner )" >
+ <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>
+ </block>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-changeassign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-changeassign.xml
new file mode 100755
index 00000000..5a0d61e5
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-changeassign.xml
@@ -0,0 +1,125 @@
+<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-changeassign' 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 'changeassign' then request-action must be 'CreateVfModuleInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <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>
+ <set>
+ <parameter name='vf-module-index' value='-1' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_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 VF modules defined in MD-SAL for VNF ' + $vf-module-topology-operation-input.vnf-information.vnf-id`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id == $vf-module-topology-operation-input.vf-module-information.vf-module-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vf-module-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-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 VF module ID ' + $vf-module-topology-operation-input.vf-module-information.vf-module-id + ' in MD-SAL'`" />
+ </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='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.onap-model-information.'
+ value='$vf-module-topology-operation-input.vf-module-information.onap-model-information.' />
+ </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='Created' />
+ <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>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-deactivate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-deactivate.xml
index 260f622b..788f0a96 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-deactivate.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-deactivate.xml
@@ -1,95 +1,177 @@
-<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-deactivate' mode='sync'>
-<block atomic="true"><switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
-<outcome value='DeleteVfModuleInstance'>
-<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 'deactivate' then request-action must be 'DeleteVfModuleInstance'" />
-</return></outcome></switch><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><set>
-<parameter name='vf-module-index' value='-1' />
-</set><switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_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 VF modules defined in MD-SAL for VNF ' + $vf-module-topology-operation-input.vnf-information.vnf-id`" />
-</return></outcome><outcome value='Other'>
-<for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
-<switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id == $vf-module-topology-operation-input.vf-module-information.vf-module-id`'>
-<outcome value='true'>
-<block>
-<set>
-<parameter name='vf-module-index' value='`$idx`' />
-</set><break/></block></outcome></switch></for></outcome></switch><switch test='`$vf-module-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 VF module ID ' + $vf-module-topology-operation-input.vf-module-information.vf-module-id + ' in MD-SAL'`" />
-</return></outcome></switch><set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-topology.vf-module-assignments.vf-module-status' value='PendingDelete' />
-</set><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+<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-deactivate' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteVfModuleInstance'>
+ <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 'deactivate' then request-action must be 'DeleteVfModuleInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <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>
+ <set>
+ <parameter name='vf-module-index' value='-1' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_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 VF modules defined in MD-SAL for VNF ' + $vf-module-topology-operation-input.vnf-information.vnf-id`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id == $vf-module-topology-operation-input.vf-module-information.vf-module-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vf-module-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-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 VF module ID ' + $vf-module-topology-operation-input.vf-module-information.vf-module-id + ' in MD-SAL'`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-vlan-tagging-deactivate' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='vm-type-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="orchestration-status" value="PendingDelete" />
+ <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 vnfc in AAI" />
+ </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 vnfc found in AAI for vnfc name ' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`" />
+ </return>
+ </outcome>
+ </update>
+ </for>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-topology.vf-module-assignments.vf-module-status' value='PendingDelete' />
+ </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="orchestration-status" value="PendingDelete" />
-<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 vf-module in AAI" />
-</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 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></outcome></update><set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.sdnc-request-header.'
+ <parameter name="orchestration-status" value="PendingDelete" />
+ <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 vf-module in AAI" />
+ </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 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>
+ </outcome>
+ </update>
+ <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.'
+ <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.'
+ <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.'
+ <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.'
+ <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.'
+ <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'
+ </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='PendingDelete' />
-<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.request-information.request-action`' />
-</set><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>
+ </set>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-unassign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-unassign.xml
index 2525dce5..d9907226 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-unassign.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation-unassign.xml
@@ -1,111 +1,239 @@
-<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-unassign' mode='sync'>
-<block atomic="true"><switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
-<outcome value='DeleteVfModuleInstance'>
-<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 'deactivate' then request-action must be 'DeleteVfModuleInstance'" />
-</return></outcome></switch><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><set>
-<parameter name='vf-module-index' value='-1' />
-</set><switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_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 VF modules defined in MD-SAL for VNF ' + $vf-module-topology-operation-input.vnf-information.vnf-id`" />
-</return></outcome><outcome value='Other'>
-<for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
-<switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id == $vf-module-topology-operation-input.vf-module-information.vf-module-id`'>
-<outcome value='true'>
-<block>
-<set>
-<parameter name='vf-module-index' value='`$idx`' />
-</set><break/></block></outcome></switch></for></outcome></switch><switch test='`$vf-module-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 VF module ID ' + $vf-module-topology-operation-input.vf-module-information.vf-module-id + ' in MD-SAL'`" />
-</return></outcome></switch><switch test='`$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`'>
-<outcome value='Created'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Order status must not be Created" />
-</return></outcome><outcome value='Other'>
-<block atomic="true"></block></outcome></switch><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" />
-</return></outcome></update><!--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><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" />
-</return></outcome></execute><for silentFailure='true' index='vm-type-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm_length`' >
-<for silentFailure='true' index='vm-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.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'
+<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-unassign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteVfModuleInstance'>
+ <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 'deactivate' then request-action must be 'DeleteVfModuleInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <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>
+ <set>
+ <parameter name='vf-module-index' value='-1' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_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 VF modules defined in MD-SAL for VNF ' + $vf-module-topology-operation-input.vnf-information.vnf-id`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id == $vf-module-topology-operation-input.vf-module-information.vf-module-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vf-module-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-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 VF module ID ' + $vf-module-topology-operation-input.vf-module-information.vf-module-id + ' in MD-SAL'`" />
+ </return>
+ </outcome>
+ </switch>
+ <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" />
+ </return>
+ </outcome>
+ </update>
+ <!--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>
+ <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" />
+ </return>
+ </outcome>
+ </execute>
+ <for silentFailure='true' index='vm-type-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vm-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.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 = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.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></block></for></for><switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
-<outcome value='1'>
-<set>
- <parameter name="service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules." value=""/>
-
-</set></outcome><outcome value='Other'>
-<block atomic="true"><for index='idx' start='`$vf-module-index + 1`' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
-<set>
- <parameter name="tmpidx" value="`$idx - 1`"/>
- <parameter name="service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$tmpidx]." value="$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx]." />
-
-</set></for><!--EIPAM plug-in needs this attribute set with this name--><set>
-<parameter name='lastidx' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length - 1`' />
-</set><set>
- <parameter name="service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$lastidx]." value=""/>
-</set><set>
- <parameter name="service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length" value="`$lastidx`"/>
-
-
-</set></block></outcome></switch><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>
+ AND vm_name = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.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>
+ </block>
+ </for>
+ </for>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-function`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="instance-groups"
+ key="instance-group.instance-group-function = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[0].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-function
+ AND instance-group.instance-group-type = 'L3-NETWORK'"
+ pfx='aai.instance-group' local-only='false' >
+ <outcome value='success'>
+ <for index='ig-index' start='0' end='`$aai.instance-group.instance-group_length`' >
+ <for index='rel-index' start='0' end='`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship_length`' >
+ <for index='reldata-index' start='0' end='`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship[$rel-index].relationship-data_length`' >
+ <switch test="`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship[$rel-index].relationship-data[$reldata-index].relationship-key
+ == 'service-instance.service-instance-id'`">
+ <outcome value='true'>
+ <switch test='`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship[$rel-index].relationship-data[$reldata-index].relationship-value
+ == $service-data.service-information.service-instance-id`'>
+ <outcome value='true'>
+ <block>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
+ <outcome value='1'>
+ <block>
+ <set>
+ <parameter name='tmp.status' value="`'PENDING_DELETE_' + $aai.instance-group.instance-group[$ig-index].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 = $aai.instance-group.instance-group[$ig-index].id" ></update>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="unassignIPAddress">
+ <parameter name="deleteEIPAM_status" value="`$tmp.status`" />
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ <for index='nig-index' start='0' end='`$service-data.network-instance-groups.network-instance-group_length`' >
+ <switch test='`$aai.instance-group.instance-group[$ig-index].id
+ == $service-data.network-instance-groups.network-instance-group[$nig-index].network-instance-group-id`'>
+ <outcome value='true'>
+ <for index='network-index' start='0' end='`$service-data.network-instance-groups.network-instance-group[$nig-index].networks.network_length`' >
+ <set>
+ <parameter name='service-data.network-instance-groups.network-instance-group[$nig-index].networks.network[$network-index].vlan-tag-id'
+ value='' />
+ <parameter name='service-data.network-instance-groups.network-instance-group[$nig-index].networks.network[$network-index].network-status'
+ value='unassigned' />
+ </set>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </for>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='vm-type-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <for silentFailure='true' index='vnfc-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vnfc"
+ key="vnfc.vnfc-name = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name"></delete>
+ </for>
+ </for>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
+ <outcome value='1'>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules." value=""/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='idx' start='`$vf-module-index + 1`' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' >
+ <set>
+ <parameter name="tmpidx" value="`$idx - 1`"/>
+ <parameter name="service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$tmpidx]." value="$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx]." />
+ </set>
+ </for>
+ <!--EIPAM plug-in needs this attribute set with this name-->
+ <set>
+ <parameter name='lastidx' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length - 1`' />
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$lastidx]." value=""/>
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length" value="`$lastidx`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation.xml
index e1179056..557afd5d 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-operation.xml
@@ -1,21 +1,38 @@
-<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' mode='sync'>
-<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='validate-vf-module-input' mode='sync' >
-</call><switch test='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`'>
-<outcome value='assign'>
-<call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign' mode='sync' >
-</call></outcome><outcome value='activate'>
-<call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-activate' mode='sync' >
-</call></outcome><outcome value='deactivate'>
-<call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-deactivate' mode='sync' >
-</call></outcome><outcome value='unassign'>
-<call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-unassign' mode='sync' >
-</call></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-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
-</return></outcome></switch><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>
+<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' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-vf-module-input' mode='sync' ></call>
+ <switch test='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign' mode='sync' ></call>
+ </outcome>
+ <outcome value='activate'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='deactivate'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='unassign'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-unassign' mode='sync' ></call>
+ </outcome>
+ <outcome value='changeassign'>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-changeassign' mode='sync' ></call>
+ </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-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
+ </return>
+ </outcome>
+ </switch>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-activate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-activate.xml
new file mode 100755
index 00000000..42c29a72
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-activate.xml
@@ -0,0 +1,313 @@
+<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-vlan-tagging-activate' mode='sync'>
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource&amp;nodesOnly=true'"
+ force="true"
+ local-only="false"
+ pfx="tmp.aai.vnf">
+ <parameter name="start[0]" value="`'/network/generic-vnfs/generic-vnf/' + $vf-module-topology-operation-input.vnf-information.vnf-id `" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="query/cloud-region-fromVnf" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="Failed call to AAI custom query: cloud-region-fromVnf" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <set>
+ <parameter name="error-message" value="No cloud region returned from AAI: cloud-region-fromVnf" />
+ </set>
+ </block>
+ </outcome>
+ </save>
+ <for index='result-idx' start='0' end='`$tmp.aai.vnf.results_length`' >
+ <block atomic="true">
+ <switch test='`$tmp.aai.vnf.results[$result-idx].cloud-region.cloud-region-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.cloud-region-id' value='`$tmp.aai.vnf.results[$result-idx].cloud-region.cloud-region-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='tmp.vlan-vnfc-instance-groups.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.`' />
+ </set>
+ <for index='vvig-index' start='0' end='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group_length`' >
+ <switch test='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group_length'
+ value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='parent-port-role'
+ value='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].vnic-interface-role`' />
+ <parameter name='vnfc-instance-group-function'
+ value='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].instance-group-function`' />
+ <parameter name='network-instance-group-function'
+ value='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-function`' />
+ </set>
+ <set>
+ <parameter name='vsig-index' value='-1' />
+ </set>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group_length`' >
+ <switch test='`
+ $parent-port-role == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$idx].parent-port-role
+ and $vnfc-instance-group-function == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$idx].vnfc-instance-group-function
+ and $network-instance-group-function == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$idx].network-instance-group-function
+`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vsig-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vsig-index`'>
+ <outcome value='-1'>
+ <block>
+ <set>
+ <parameter name='vsig-index'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group_length`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].parent-port-role'
+ value='`$parent-port-role`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfc-instance-group-function'
+ value='`$vnfc-instance-group-function`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].network-instance-group-function'
+ value='`$network-instance-group-function`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group_length'
+ value='`$vsig-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.aai.network">
+ <parameter name="start[0]" value="`'/cloud-infrastructure/cloud-regions/cloud-region/' + $prop.cloud-region.cloud-owner + '/' + $tmp.cloud-region-id`" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="`'/query/network-name-fromNetwork-role?networkRole=' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].parent-port-role`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to get network data for network role '
+ + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].parent-port-role`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to get network data for network role '
+ + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].parent-port-role`" />
+ </return>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='network-name' value='`$tmp.aai.network.results[0].l3-network.network-name`' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc_length'
+ value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='dest-vnfc-index'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc_length`' />
+ </set>
+ <for index='src-vnfc-index' start='0'
+ end='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vnfc-name'
+ value='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$src-vnfc-index].vnfc-name`' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.aai.interfaces">
+ <parameter name="start[0]" value="`'/network/vnfcs/vnfc/' + $tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$src-vnfc-index].vnfc-name`" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="`'/query/vserver-l-interfaces-fromVnfc?networkName=' + $network-name`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Failed to get interface data for network name '
+ + $network-name
+ + ' and vnfc '
+ + $tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$src-vnfc-index].vnfc-name`" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <block></block>
+ </outcome>
+ <outcome value='success'>
+ <block>
+ <for silentFailure='true' index='idx1' start='0' end='`$tmp.aai.interfaces.results_length`' >
+ <switch test='`$tmp.aai.interfaces.results[$idx1].vserver.vserver-id`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vserver-id'
+ value='`$tmp.aai.interfaces.results[$idx1].vserver.vserver-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vserver-name'
+ value='`$tmp.aai.interfaces.results[$idx1].vserver.vserver-name`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vnics.vnic_length'
+ value='`$tmp.aai.interfaces.results[$idx1].vserver.l-interfaces.l-interface_length`' />
+ </set>
+ <for silentFailure='true' index='int-index' start='0'
+ end='`$tmp.aai.interfaces.results[$idx1].vserver.l-interfaces.l-interface_length`' >
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vnics.vnic[$int-index].vnic-port-id'
+ value='`$tmp.aai.interfaces.results[$idx1].vserver.l-interfaces.l-interface[$int-index].interface-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vnics.vnic[$int-index].vnic-port-name'
+ value='`$tmp.aai.interfaces.results[$idx1].vserver.l-interfaces.l-interface[$int-index].interface-name`' />
+ </set>
+ <for silentFailure='true' index='idx2' start='0' end='`$tmp.aai.interfaces.results_length`' >
+ <switch test='`$tmp.aai.interfaces.results[$idx2].l-interface.interface-id
+ == $tmp.aai.interfaces.results[$idx1].vserver.l-interfaces.l-interface[$int-index].interface-id`'>
+ <outcome value='true'>
+ <block>
+ <switch test='`$tmp.aai.interfaces.results[$idx2].l-interface.l-interfaces.l-interface_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vnics.vnic[$int-index].sub-interfaces.sub-interface_length'
+ value='`$tmp.aai.interfaces.results[$idx2].l-interface.l-interfaces.l-interface_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='sub-int-index' start='0'
+ end='`$tmp.aai.interfaces.results[$idx2].l-interface.l-interfaces.l-interface_length`' >
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vnics.vnic[$int-index].sub-interfaces.sub-interface[$sub-int-index].sub-interface-port-id'
+ value='`$tmp.aai.interfaces.results[$idx2].l-interface.l-interfaces.l-interface[$sub-int-index].interface-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vnics.vnic[$int-index].sub-interfaces.sub-interface[$sub-int-index].sub-interface-port-name'
+ value='`$tmp.aai.interfaces.results[$idx2].l-interface.l-interfaces.l-interface[$sub-int-index].interface-name`' />
+ </set>
+ <for silentFailure='true' index='idx3' start='0' end='`$tmp.aai.interfaces.results_length`' >
+ <switch test='`$tmp.aai.interfaces.results[$idx3].l-interface.interface-id
+ == $tmp.aai.interfaces.results[$idx2].l-interface.l-interfaces.l-interface[$sub-int-index].interface-id`'>
+ <outcome value='true'>
+ <switch test='`$tmp.aai.interfaces.results[$idx3].l-interface.vlans.vlan[0].vlan-interface`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <for silentFailure='true' index='idx4' start='0' end='`$tmp.aai.interfaces.results_length`' >
+ <switch test='`$tmp.aai.interfaces.results[$idx4].vlan.vlan-interface
+ == $tmp.aai.interfaces.results[$idx3].l-interface.vlans.vlan[0].vlan-interface`'>
+ <outcome value='true'>
+ <block>
+ <switch test='`$tmp.aai.interfaces.results[$idx4].vlan.vlan-id-outer`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vnics.vnic[$int-index].sub-interfaces.sub-interface[$sub-int-index].vlan-tags.upper-tag-id'
+ value='`$tmp.aai.interfaces.results[$idx4].vlan.vlan-id-outer`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.aai.interfaces.results[$idx4].vlan.vlan-id-inner`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$dest-vnfc-index].vnics.vnic[$int-index].sub-interfaces.sub-interface[$sub-int-index].vlan-tags.lower-tag-id'
+ value='`$tmp.aai.interfaces.results[$idx4].vlan.vlan-id-inner`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='dest-vnfc-index' value='`$dest-vnfc-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc_length'
+ value='`$dest-vnfc-index`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-assign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-assign.xml
new file mode 100755
index 00000000..f4518124
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-assign.xml
@@ -0,0 +1,791 @@
+<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-vlan-tagging-assign' mode='sync'>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="select distinct vmvm.vm_type, rg.group_uuid from VF_MODULE_TO_VFC_MAPPING vmvm, VFC_MODEL vm,
+ RESOURCE_GROUP_TO_TARGET_NODE_MAPPING rgm, RESOURCE_GROUP rg
+ where vf_module_customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid
+ and vmvm.vfc_customization_uuid = vm.customization_uuid
+ and vmvm.vm_type = vm.vm_type
+ and vm.uuid = rgm.target_node_uuid
+ and rgm.target_type = 'CVFC'
+ and rgm.group_uuid = rg.group_uuid"
+ pfx='db.group-uuids[]'>
+ <outcome value='failure'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="System error getting group uuids from DB" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <for index='group-index' start='0' end='`$db.group-uuids_length`' >
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="select attribute_name, attribute_value from ATTRIBUTE_VALUE_PAIR
+ where resource_uuid = $db.group-uuids[$group-index].group-uuid
+ and attribute_name in ('vfc_instance_group_function','vfc_parent_port_role','network_collection_function')"
+ pfx='db.parameters[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="System error getting parameters from ATTRIBUTE_VALUE_PAIR 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="`'Unable to find parameters ATTRIBUTE_VALUE_PAIR table for group ' + $db.group-uuids[$group-index].group-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <for index='parameter-index' start='0' end='`$db.parameters_length`' >
+ <switch test='`$db.parameters[$parameter-index].attribute-name`'>
+ <outcome value='vfc_parent_port_role'>
+ <set>
+ <parameter name='db.group-uuids[$group-index].vfc_parent_port_role' value='`$db.parameters[$parameter-index].attribute-value`' />
+ </set>
+ </outcome>
+ <outcome value='vfc_instance_group_function'>
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="startsWith" emitsOutcome='true' >
+ <parameter name="source" value="`$db.parameters[$parameter-index].attribute-value`" />
+ <parameter name="target" value="get_input=" />
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Parameter value for '
+ + $db.parameters[$parameter-index].attribute-name
+ + ' is '
+ + $db.parameters[$parameter-index].attribute-value
+ + ' but was expected to start with get_input='`" />
+ </return>
+ </outcome>
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring'>
+ <parameter name='result' value='tmp.truncated-value' />
+ <parameter name='string' value='`$db.parameters[$parameter-index].attribute-value`' />
+ <parameter name='begin-index' value='10' />
+ </execute>
+ </outcome>
+ </execute>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="select attribute_value from VF_MODULE_MODEL vmm, VF_MODEL vf, ATTRIBUTE_VALUE_PAIR avp
+ where vmm.customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid
+ and vmm.vf_customization_uuid = vf.customization_uuid
+ and vf.uuid = avp.resource_uuid
+ and vmm.vf_customization_uuid = avp.resource_customization_uuid
+ and avp.attribute_name = $tmp.truncated-value"
+ pfx='db.mapped-value'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'System error retrieving mapped parameter value for '
+ + $db.parameters[$parameter-index].attribute-name`" />
+ </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="`'Unable to find mapped parameter value for '
+ + $db.parameters[$parameter-index].attribute-name
+ + ' value '
+ + $tmp.truncated-value`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='db.group-uuids[$group-index].vfc-instance-group-function' value='`$db.mapped-value.attribute-value`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='network_collection_function'>
+ <block atomic="true">
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="startsWith" emitsOutcome='true' >
+ <parameter name="source" value="`$db.parameters[$parameter-index].attribute-value`" />
+ <parameter name="target" value="get_input=" />
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Parameter value for '
+ + $db.parameters[$parameter-index].attribute-name
+ + ' is '
+ + $db.parameters[$parameter-index].attribute-value
+ + ' but was expected to start with get_input='`" />
+ </return>
+ </outcome>
+ <outcome value='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='substring'>
+ <parameter name='result' value='tmp.truncated-value' />
+ <parameter name='string' value='`$db.parameters[$parameter-index].attribute-value`' />
+ <parameter name='begin-index' value='10' />
+ </execute>
+ </outcome>
+ </execute>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="select attribute_value from VF_MODULE_MODEL vmm, VF_MODEL vf, ATTRIBUTE_VALUE_PAIR avp
+ where vmm.customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid
+ and vmm.vf_customization_uuid = vf.customization_uuid
+ and vf.uuid = avp.resource_uuid
+ and vmm.vf_customization_uuid = avp.resource_customization_uuid
+ and avp.attribute_name = $tmp.truncated-value"
+ pfx='db.mapped-value'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'System error retrieving mapped parameter value for '
+ + $db.parameters[$parameter-index].attribute-name`" />
+ </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="`'Unable to find mapped parameter value for '
+ + $db.parameters[$parameter-index].attribute-name
+ + ' value '
+ + $tmp.truncated-value`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='db.group-uuids[$group-index].network-collection-function' value='`$db.mapped-value.attribute-value`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </get-resource>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="instance-groups"
+ key="instance-group.instance-group-function = $db.group-uuids[$group-index].vfc-instance-group-function
+ AND instance-group.instance-group-type = 'VNFC'"
+ pfx='aai.instance-group' 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="`'Unable to find AAI instance-group for instance-group-function '
+ + $db.group-uuids[$group-index].vfc-instance-group-function
+ + ' and instance-group-type VNFC'`" />
+ </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="`'System error getting AAI instance-group for instance-group-function '
+ + $db.group-uuids[$group-index].vfc-instance-group-function
+ + ' and instance-group-type VNFC'`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='found-instance-group' value='false' />
+ </set>
+ <for index='ig-index' start='0' end='`$aai.instance-group.instance-group_length`' >
+ <for index='rel-index' start='0' end='`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship_length`' >
+ <for index='reldata-index' start='0' end='`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship[$rel-index].relationship-data_length`' >
+ <switch test="`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship[$rel-index].relationship-data[$reldata-index].relationship-key
+ == 'service-instance.service-instance-id'`">
+ <outcome value='true'>
+ <switch test='`$aai.instance-group.instance-group[$ig-index].relationship-list.relationship[$rel-index].relationship-data[$reldata-index].relationship-value
+ == $service-data.service-information.service-instance-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-instance-group' value='true' />
+ </set>
+ <set>
+ <parameter name='aai-ig-index' value='`$ig-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </for>
+ <switch test='`$found-instance-group`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Unable to find AAI instance-group for instance-group-function '
+ + $db.group-uuids[$group-index].vfc-instance-group-function
+ + ' and instance-group-type VNFC'`" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='vvig-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <break/>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='vvig-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].instance-group-id
+ == $aai.instance-group.instance-group[$aai-ig-index].id`'>
+ <outcome value='true'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Instance group id '
+ + $aai.instance-group.instance-group[$aai-ig-index].id
+ + ' already exists in MD-SAL under vlan-vnfc-instance-groups'`" />
+ </return>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='vvig-index' value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].instance-group-id'
+ value='`$aai.instance-group.instance-group[$aai-ig-index].id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].instance-group-function'
+ value='`$db.group-uuids[$group-index].vfc-instance-group-function`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnf-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group_length'
+ value='`$vvig-index + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vm-type'
+ value='`$db.group-uuids[$group-index].vm-type`' />
+ </set>
+ <set>
+ <parameter name='found-vm-type' value='false' />
+ </set>
+ <for index='vm-type-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-type
+ == $db.group-uuids[$group-index].vm-type`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-vm-type' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-vm-type`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'TOSCA provided vm-type ' +
+ $db.group-uuids[$group-index].vm-type + ' but that was not found in vf-module-assignments.vms'`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc_length'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' />
+ </set>
+ <for index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnfc-name'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-name`' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="instance-group:relationship-list"
+ key="instance-group.id = $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].instance-group-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="vnfc" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/vnfcs/vnfc/' +
+ $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnfc-name`" />
+ <outcome value='failure'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="System error creating instance-group relationship to vnfc" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Not-found error relating instance group '
+ + $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].instance-group-id
+ + ' to vnfc '
+ + $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnfc-name`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].data-created' value='true' />
+ </set>
+ </block>
+ </for>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="select property_name from VF_MODULE_TO_VFC_MAPPING vmvm,
+ RESOURCE_POLICY_TO_TARGET_NODE_MAPPING rptnm, RESOURCE_POLICY rp
+ where vmvm.vf_module_customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid
+ AND vmvm.vm_type = $db.group-uuids[$group-index].vm-type
+ AND vmvm.vfc_customization_uuid = rptnm.target_node_uuid
+ AND rptnm.policy_uuid = rp.policy_uuid
+ AND rp.property_type = 'vlan_tag_policy'
+ AND rp.policy_type = 'ecomp.policies.External'
+ AND rp.property_source = 'Policy Manager'"
+ pfx='db.policy[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failure retrieving policy for vm-type ' + $db.group-uuids[$group-index].vm-type`" />
+ </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="`'Unable to find policy for vm-type ' + $db.group-uuids[$group-index].vm-type`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].vnic-interface-role'
+ value='`$db.group-uuids[$group-index].vfc_parent_port_role`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].vlan-assignment-policy-name'
+ value='`$db.policy[0].property-name`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].network-instance-group-function'
+ value='`$db.group-uuids[$group-index].network-collection-function`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group_length'
+ value='1' />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="select vnrm.* from VF_MODULE_TO_VFC_MAPPING vmvm, VFC_TO_NETWORK_ROLE_MAPPING vnrm
+ where vmvm.vf_module_customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid
+ AND vmvm.vm_type = $db.group-uuids[$group-index].vm-type
+ AND vmvm.vfc_customization_uuid = vnrm.vfc_customization_uuid
+ AND vnrm.network_role_tag = $db.group-uuids[$group-index].vfc_parent_port_role"
+ pfx='db.vfc-to-network-role[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failure reading VFC_TO_NETWORK_ROLE_MAPPING for parent role ' + $db.group-uuids[$group-index].vfc_parent_port_role`" />
+ </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="`'Unable to find rows in VFC_TO_NETWORK_ROLE_MAPPING for parent role ' + $db.group-uuids[$group-index].vfc_parent_port_role`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <for index='vnic-index' start='0' end='`$db.vfc-to-network-role_length`' >
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].vlan-vnics.vlan-vnic[$vnic-index].vnic-port-id'
+ value='`$vnic-index`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnic-groups.vnic-group[0].vlan-vnics.vlan-vnic_length'
+ value='`$db.vfc-to-network-role_length`' />
+ </set>
+ <set>
+ <parameter name='get-data-from-policy-input.policy-instance-name' value='`$db.policy[0].property-name`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='get-data-from-policy' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ <switch test='`$get-data-from-policy-output.precreate-sub-intf-num &gt; 0`'>
+ <outcome value='true'>
+ <call module='GENERIC-RESOURCE-API' rpc='assign-vlan-tags' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ </outcome>
+ </switch>
+ <for index='vnfc-index' start='1' end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc_length`' >
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnics-groups.'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[0].vnics-groups.`' />
+ </set>
+ </for>
+ <set>
+ <parameter name='counter' value='0' />
+ </set>
+ <set>
+ <parameter name='seq-no' value='1' />
+ </set>
+ <for index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc_length`' >
+ <for index='vnic-group-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vt-ip.' value='' />
+ </set>
+ <set>
+ <parameter name='tmp.vt-ip.network-instance-group-function'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].network-instance-group-function`' />
+ <parameter name='tmp.vt-ip.nf-role'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-role`' />
+ <parameter name='tmp.vt-ip.vm-type'
+ value='`$db.group-uuids[$group-index].vm-type`' />
+ <parameter name='tmp.vt-ip.vnfc-name'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnfc-name`' />
+ <parameter name='tmp.vt-ip.type'
+ value='FIXED' />
+ <parameter name='tmp.vt-ip.vf-module-id'
+ value='`$vf-module-topology-operation-input.vf-module-information.vf-module-id`' />
+ </set>
+ <for index='nig-index' start='0' end='`$service-data.network-instance-groups.network-instance-group_length`' >
+ <switch test='`$tmp.vt-ip.network-instance-group-id
+ == $service-data.network-instance-groups.network-instance-group[$nig-index].network-instance-group-id`'>
+ <outcome value='true'>
+ <switch test='`$get-data-from-policy-output.ip-assignment`'>
+ <outcome value='shared'>
+ <for silentFailure='true' index='subnet-index' start='0'
+ end='`$service-data.network-instance-groups.network-instance-group[$nig-index].subnets_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vt-ip.ip-version'
+ value='`$service-data.network-instance-groups.network-instance-group[$nig-index].subnets[$subnet-index].ip-version`' />
+ <parameter name='tmp.vt-ip.network-instance-group-id'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].network-instance-group-id`' />
+ <parameter name='tmp.vt-ip.sequence-number'
+ value='`$seq-no`' />
+ </set>
+ <set>
+ <parameter name='counter' value='`$counter + 1`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-vlan-tagging-ip-addresses' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ <switch test='`$eipam-ip-block.plans_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <for index='vnic-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic_length`' >
+ <for index='sub-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data_length`' >
+ <block>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item_length'
+ value='1' />
+ <parameter name='tmp.index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item_length'
+ value='1' />
+ <parameter name='tmp.index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='1'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item_length'
+ value='2' />
+ <parameter name='tmp.index' value='1' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].network-ips.network-ip[0]'
+ value='`$eipam-ip-block.plans[0].requests[0].ip-prefix`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].network-ips.network-ip_length'
+ value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].ip-version'
+ value='`$tmp.vt-ip.ip-version`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].ip-count'
+ value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].use-dhcp'
+ value='N' />
+ </set>
+ <switch test='`$tmp.vt-ip.ip-version`'>
+ <outcome value='ipv4'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-common-ip-addresses.ip-addresses.ipv4-address'
+ value='`$eipam-ip-block.plans[0].requests[0].ip-prefix`' />
+ </set>
+ </outcome>
+ <outcome value='ipv6'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-common-ip-addresses.ip-addresses.ipv6-address'
+ value='`$eipam-ip-block.plans[0].requests[0].ip-prefix`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='seq-no' value='`$seq-no + 1`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value="`'/var/tmp/bgb-eipam.log' + $counter`" />
+ </execute>
+ </block>
+ </for>
+ </outcome>
+ <outcome value='unique'>
+ <for silentFailure='true' index='subnet-index' start='0'
+ end='`$service-data.network-instance-groups.network-instance-group[$nig-index].subnets_length`' >
+ <for index='vnic-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic_length`' >
+ <set>
+ <parameter name='tmp.vt-ip.ip-version'
+ value='`$service-data.network-instance-groups.network-instance-group[$nig-index].subnets[$subnet-index].ip-version`' />
+ </set>
+ <for index='sub-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vt-ip.network-id'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-id`' />
+ <parameter name='tmp.vt-ip.sequence-number'
+ value='`$seq-no`' />
+ </set>
+ <set>
+ <parameter name='counter' value='`$counter + 1`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-vlan-tagging-ip-addresses' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'></return>
+ </outcome>
+ </call>
+ <switch test='`$eipam-ip-block.plans_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item_length'
+ value='1' />
+ <parameter name='tmp.index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item_length'
+ value='1' />
+ <parameter name='tmp.index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='1'>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item_length'
+ value='2' />
+ <parameter name='tmp.index' value='1' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].network-ips.network-ip[0]'
+ value='`$eipam-ip-block.plans[0].requests[0].ip-prefix`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].network-ips.network-ip_length'
+ value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].ip-version'
+ value='`$tmp.vt-ip.ip-version`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].ip-count'
+ value='1' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.sub-interface-network-data[$sub-index].network-information-items.network-information-item[$tmp.index].use-dhcp'
+ value='N' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='seq-no' value='`$seq-no + 1`' />
+ </set>
+ </block>
+ </for>
+ </for>
+ </for>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'From policy: ip-assignment is '
+ + $get-data-from-policy-output.ip-assignment
+ + ' but must be unique or shared'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </for>
+ <for index='vnfc-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc_length`' >
+ <for index='vm-vnfc-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnfc-name
+ == $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vm-vnfc-index].vnfc-name`'>
+ <outcome value='true'>
+ <for index='vnic-group-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group_length`' >
+ <block>
+ <set>
+ <parameter name='vnfc-network-index' value='-1' />
+ </set>
+ <for index='vn-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vnic-interface-role
+ == $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-network-role`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vnfc-network-index' value='`$vn-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vnfc-network-index`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Cannot find vnfc-network for network role '
+ + $tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vnic-interface-role`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-network-role.vnfc-type'
+ value='`$db.group-uuids[$group-index].vm-type`' />
+ </set>
+ <for index='vnic-index' start='0'
+ end='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic_length`' >
+ <block>
+ <set>
+ <parameter name='vnfc-port-index' value='-1' />
+ </set>
+ <for silentFailure='true' index='v-index' start='0' end='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-ports.vnfc-port_length`' >
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-port-id
+ == $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-ports.vnfc-port[$v-index].vnfc-port-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vnfc-port-index' value='`$v-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vnfc-port-index`'>
+ <outcome value='-1'>
+ <block>
+ <switch test='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-ports.vnfc-port_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='vnfc-port-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='vnfc-port-index' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-ports.vnfc-port_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnfc-port-id'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-port-id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-ports.vnfc-port[$vnfc-port-index].common-sub-interface-role'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vnic-interface-role`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-ports.vnfc-port_length'
+ value='`$vnfc-port-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'></outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-names.vnfc-names[$vnfc-index].vnfc-networks.vnfc-network-data[$vn-index].vnfc-ports.vnfc-port[$vnfc-port-index].vnic-sub-interfaces.'
+ value='`$tmp.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vlan-vnics.vlan-vnic[$vnic-index].vnic-sub-interfaces.`' />
+ </set>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </get-resource>
+ <return status='success'></return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-deactivate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-deactivate.xml
new file mode 100755
index 00000000..b39e1160
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-deactivate.xml
@@ -0,0 +1,88 @@
+<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-vlan-tagging-deactivate' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vlan-vnfc-instance-groups.'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-assignments.vlan-vnfc-instance-groups.`' />
+ </set>
+ <for index='vvig-index' start='0' end='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group_length`' >
+ <for index='vnfc-index' start='0' end='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc_length`' >
+ <for index='vnic-group-index' start='0' end='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='parent-port-role'
+ value='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].vnic-interface-role`' />
+ <parameter name='network-instance-group-function'
+ value='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnic-groups.vnic-group[$vnic-group-index].network-instance-group-function`' />
+ <parameter name='vnfc-instance-group-function'
+ value='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].instance-group-function`' />
+ </set>
+ <for silentFailure='true' index='vsig-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group_length`' >
+ <switch test='`
+ $parent-port-role == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].parent-port-role
+ and $vnfc-instance-group-function == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfc-instance-group-function
+ and $network-instance-group-function == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].network-instance-group-function
+`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].customer-bonding-requests.customer-bonding-request_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Cannot deactivate module because customer bonding request exists' />
+ </return>
+ </outcome>
+ </switch>
+ <for index='vnf-vnfc-index' start='0'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc_length`' >
+ <switch test='`$tmp.vlan-vnfc-instance-groups.vlan-vnfc-instance-group[$vvig-index].vnfcs.vnfc[$vnfc-index].vnfc-name
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$vnf-vnfc-index].vnfc-name`'>
+ <outcome value='true'>
+ <block>
+ <for index='$idx' start='`$vnf-vnfc-index`'
+ end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc_length - 1`' >
+ <block>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$idx].'
+ value='' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$idx].'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$idx + 1].`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc_length'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc_length - 1`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc[$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-sub-interface-groups.vnf-sub-interface-group[$vsig-index].vnfcs.vnfc_length].' value='' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ </for>
+ </for>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-ip-addresses.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-ip-addresses.xml
new file mode 100644
index 00000000..9a7a73b7
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vf-module-topology-vlan-tagging-ip-addresses.xml
@@ -0,0 +1,289 @@
+<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-vlan-tagging-ip-addresses' mode='sync'>
+ <block atomic="true">
+ <switch test='`$tmp.vt-ip.type`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='type is required' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vt-ip.network-instance-group-function`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='network-instance-group-function is required for FIXED ip request' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vt-ip.ip-version`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='ip-version is required' />
+ </return>
+ </outcome>
+ <outcome value='ipv4'>
+ <set>
+ <parameter name='tmp.address-family' value='4' />
+ <parameter name='tmp.sql.address-family' value='%4' />
+ </set>
+ </outcome>
+ <outcome value='ipv6'>
+ <set>
+ <parameter name='tmp.address-family' value='6' />
+ <parameter name='tmp.sql.address-family' value='%6' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='eipam-ip-block.' value='' />
+ </set>
+ <switch test='`$tmp.vt-ip.type`'>
+ <outcome value='FIXED'>
+ <block atomic='true'>
+ <switch test='`$tmp.vt-ip.vnfc-name`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='vnfc-name is required for FIXED ip request' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vt-ip.vf-module-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='vf-module-id is required' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$tmp.vt-ip.sequence-number`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='seq-num is required' />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.selected-client-key"
+ value="`$tmp.vt-ip.vm-type + '|' +
+ $tmp.vt-ip.vnfc-name + '|' +
+ $tmp.vt-ip.network-instance-group-function + '|' +
+ $tmp.vt-ip.type + '|' +
+ $tmp.address-family + '|' +
+ $tmp.vt-ip.sequence-number`" />
+ <!--
+fixed-ip client-key:
+vm-type + VFCname + network-instance-group-function + "FIXED" + [ip-version(4/6)] + seqNo
+ seqNo required for unique, but not required for shared
+-->
+ </set>
+ <set>
+ <parameter name="tmp.eipam.info" value="`$tmp.vt-ip.vf-module-id`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='VIP'>
+ <block atomic='true'>
+ <switch test='`$tmp.vt-ip.nf-role`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='nf-role is required for VIP ip request' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.vt-ip.network-instance-group-id == '' `">
+ <outcome value='true'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='network-isntance-group-id is required for VIP' />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="tmp.eipam.info" value="`$tmp.vt-ip.network-instance-group-id`"/>
+ </set>
+ <set>
+ <parameter name='tmp.selected-client-key'
+ value="`$tmp.vt-ip.nf-role + '|' +
+ $tmp.vt-ip.network-instance-group-function + '|' +
+ $tmp.vt-ip.type + '|' +
+ $tmp.vt-ip.ip-version`" />
+ <!--
+loating-ip client-key:
+nf-role + network-instance-group-function + "VIP" + [ip-version(4/6)]
+-->
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.vt-ip.network-id == '' and $tmp.vt-ip.network-instance-group-id == '' `">
+ <outcome value='true'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='either network-id or network-isntance-group-id is required' />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.vt-ip.network-id != '' `">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.sql'
+ value="`'SELECT * from EIPAM_IP_SUBNETS WHERE network_id = ' +
+ '$tmp.vt-ip.network-id AND address_family like $tmp.sql.address-family'`" />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='`$tmp.sql`' pfx='db.selected-subnet-data[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value = 'Failed to read EIPAM_IP_SUBNETS table' />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value = "`'No EIPAM_IP_SUBNETS entry found with network-id = ' + $tmp.vt-ip.network-id + ' and address_family = ' + $tmp.address-family`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name="eipam-ip-block.plans[0].requests[0].network-id"
+ value="`$tmp.vt-ip.network-id`"/>
+ </set>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <switch test="`$tmp.vt-ip.network-instance-group-id != '' `">
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='tmp.sql'
+ value="`'SELECT * from EIPAM_IP_SUBNETS WHERE network_instance_group_id = '+
+ '$tmp.vt-ip.network-instance-group-id AND address_family like $tmp.sql.address-family'`" />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='`$tmp.sql`' pfx='db.selected-subnet-data[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value = 'Failed to read EIPAM_IP_SUBNETS table' />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value = "`'No EIPAM_IP_SUBNETS entry found with network-instance-group-id = ' + $tmp.vt-ip.network-instance-group-id + ' and address_family = ' + $tmp.address-family`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name="eipam-ip-block.plans[0].requests[0].network-instance-group-id"
+ value="`$tmp.vt-ip.network-instance-group-id`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.level4-key-found' value='false' />
+ </set>
+ <for index='didx' start='0' end='`$db.selected-subnet-data_length`' >
+ <set>
+ <parameter name='tmp.sql'
+ value="`'SELECT a.entity_id, a.key_name, a.key_value, a.level from EIPAM_IP_SUBNET_KEYS a where level = (SELECT MAX(level) from EIPAM_IP_SUBNET_KEYS b where b.entity_id = a.entity_id and entity_id = ' + ' $db.selected-subnet-data[$didx].entity-id )'`" />
+ </set>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='`$tmp.sql`' pfx='db.selected-subnet-keys'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value = 'Failed to read EIPAM_IP_SUBNET_KEYS table to find MAX level by entity_id' />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <switch test="`$db.selected-subnet-keys.level == '4' `">
+ <outcome value='false'>
+ <block></block>
+ </outcome>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='tmp.level4-key-found' value='true' />
+ </set>
+ <set>
+ <parameter name='tmp.selected-entity-id' value='`$db.selected-subnet-keys.entity-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.selected-plan-name' value='`$db.selected-subnet-data[$didx].plan-name`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </get-resource>
+ </for>
+ <switch test="`$tmp.level4-key-found`">
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='No level 4 KeyName found in EIPAM_IP_SUBNET_KEYS' />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from EIPAM_IP_SUBNET_KEYS
+ where entity_id = $tmp.selected-entity-id order by level'
+ pfx='db.eipam-subnet-keys[]'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value = 'Failed to read EIPAM_IP_SUBNET_KEYS table by entity_id' />
+ </return>
+ </outcome>
+ </get-resource>
+ <for index='key' start='0' end='`$db.eipam-subnet-keys_length`' >
+ <set>
+ <parameter name="eipam-ip-block.plans[0].requests[0].pools[$key].key-name"
+ value="`$db.eipam-subnet-keys[$key].key-name`"/>
+ <parameter name="eipam-ip-block.plans[0].requests[0].pools[$key].key-value"
+ value="`$db.eipam-subnet-keys[$key].key-value`"/>
+ </set>
+ </for>
+ <set>
+ <parameter name='eipam-ip-block.plans[0].plan-name' value='`$tmp.selected-plan-name`' />
+ <parameter name='eipam-ip-block.plans[0].address-family' value="`$tmp.vt-ip.ip-version`" />
+ <parameter name='eipam-ip-block.plans[0].requests[0].client-key'
+ value="`$tmp.selected-client-key`" />
+ <parameter name="eipam-ip-block.plans[0].requests[0].info"
+ value="`$tmp.eipam.info`"/>
+ <parameter name="eipam-ip-block.plans[0].requests[0].pools_length" value="4"/>
+ <parameter name='eipam-ip-block.plans[0].requests_length' value='1' />
+ <parameter name="eipam-ip-block.plans_length" value="1"/>
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/vlan-tag-ip.log' />
+ </execute>
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="assignIPAddress">
+ <outcome value='failure'>
+ <block atomic="true">
+ <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 ip addresses from EIPAM: ' + $error-message`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-get-resource-request.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-get-resource-request.xml
new file mode 100644
index 00000000..d602cc0e
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-get-resource-request.xml
@@ -0,0 +1,242 @@
+<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='vnf-get-resource-request' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name="vnf-get-resource-request-output.vnf-get-resource-response-information.service-instance-id" value='`$vnf-get-resource-request-input.service-information.service-instance-id`'/>
+ <parameter name="vnf-get-resource-request-output.vnf-get-resource-response-information.service-instance-name" value='`$service-data.service-topology.service-topology-identifier.service-instance-name`'/>
+ </set>
+ <switch test="`$vnf-get-resource-request-input.vnf_length == ''`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name="vnf-get-resource-request-output.vnf-get-resource-response-information.vnf_length" value='`$service-data.vnfs.vnf_length`'/>
+ </set>
+ <switch test="`$service-data.vnfs.vnf_length == ''`">
+ <outcome value='false'>
+ <for index='i' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vnf-id`' value="`$service-data.vnfs.vnf[$i].vnf-id`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vnf-name`' value="`$service-data.vnfs.vnf[$i].vnf-name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].param_length`' value='`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param_length`'/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vf-module_length`' value='`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module_length`'/>
+ </set>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param_length == ''`">
+ <outcome value='false'>
+ <for index='j' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].param[$j].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].param[$j].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].value`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].param[$j].resource-resolution-data.status`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.status`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].param[$j].resource-resolution-data.capability-name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.capability-name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].param[$j].resource-resolution-data.resource-key_length`' value='`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.resource-key_length`' />
+ </set>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.resource-key_length == ''`">
+ <outcome value='false'>
+ <for index='k' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.resource-key_length`' >
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].param[$j].resource-resolution-data.resource-key[$k].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.resource-key[$k].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].param[$j].resource-resolution-data.resource-key[$k].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.resource-key[$k].value`"/>
+ </set>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module_length == ''`">
+ <outcome value='false'>
+ <for index='l' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vf-module[$l].vf-module-id`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-id`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vf-module[$l].param_length`' value="`service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-data.vf-module-topology.vf-module-parameters.param_length`"/>
+ </set>
+ <for index='m' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vf-module[$l].param[$m].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vf-module[$l].param[$m].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].value`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vf-module[$l].param[$m].resource-resolution-data.resource-key_length`' value="`service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key_length`"/>
+ </set>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key_length == ''`">
+ <outcome value='false'>
+ <for index='n' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key_length`' >
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vf-module[$l].param[$m].resource-resolution-data.resource-key[$n].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key[$n].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$i].vf-module[$l].param[$m].resource-resolution-data.resource-key[$n].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$l].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key[$n].value`"/>
+ </set>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.vnf_counter" value='0'/>
+ </set>
+ <for index='ll' start='0' end='`$vnf-get-resource-request-input.vnf_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name="tmp.vnf-id" value="`$vnf-get-resource-request-input.vnf[$ll].vnf-id`"/>
+ </set>
+ <switch test="`$service-data.vnfs.vnf_length == ''`">
+ <outcome value='false'>
+ <for index='i' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <block atomic="true">
+ <switch test='`$tmp.vnf-id == $service-data.vnfs.vnf[$i].vnf-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vnf-id`' value="`$service-data.vnfs.vnf[$i].vnf-id`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vnf-name`' value="`$service-data.vnfs.vnf[$i].vnf-name`"/>
+ <parameter name="tmp.pnum" value='0'/>
+ </set>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param_length == ''`">
+ <outcome value='false'>
+ <for index='j' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].param[$tmp.pnum].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].param[$tmp.pnum].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].value`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].param[$tmp.pnum].resource-resolution-data.status`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.status`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].param[$tmp.pnum].resource-resolution-data.capability-name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.capability-name`"/>
+ <parameter name='tmp.prnum' value='0' />
+ </set>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.resource-key_length == ''`">
+ <outcome value='false'>
+ <for index='k' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.resource-key_length`' >
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].param[$tmp.pnum].resource-resolution-data.resource-key[$tmp.prnum].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.resource-key[$k].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].param[$tmp.pnum].resource-resolution-data.resource-key[$tmp.prnum].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vnf-topology.vnf-parameters-data.param[$j].resource-resolution-data.resource-key[$k].value`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].param[$tmp.pnum].resource-resolution-data.resource-key_length`' value='`$tmp.prnum + 1`' />
+ <parameter name='tmp.prnum' value='`$tmp.prnum + 1`' />
+ </set>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].param_length`' value='`$tmp.pnum + 1`' />
+ <parameter name='tmp.pnum' value='`$tmp.pnum + 1`' />
+ </set>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module_length == ''`">
+ <outcome value='false'>
+ <for index='ln' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module_length`' >
+ <switch test="`$vnf-get-resource-request-input.vnf[$ll].vf-module_length == ''`">
+ <outcome value='false'>
+ <for index='jj' start='0' end='`$vnf-get-resource-request-input.vnf[$ll].vf-module_length`' >
+ <switch test='`$vnf-get-resource-request-input.vnf[$ll].vf-module[$jj].vf-module-id == $service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-id`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].vf-module-id`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-id`"/>
+ <parameter name="tmp.vfpnum" value='0'/>
+ </set>
+ <for index='m' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].value`"/>
+ <parameter name='tmp.pvnfrnum' value='0' />
+ </set>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key_length == ''`">
+ <outcome value='false'>
+ <for index='n' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key_length`' >
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].resource-resolution-data.resource-key[$tmp.pvnfrnum].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key[$n].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].resource-resolution-data.resource-key[$tmp.pvnfrnum].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key[$n].value`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].resource-resolution-data.resource-key_length`' value='`$tmp.pvnfrnum + 1`' />
+ <parameter name='tmp.pvnfrnum' value='`$tmp.pvnfrnum + 1`' />
+ </set>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param_length`' value='`$tmp.vfpnum + 1`' />
+ <parameter name='tmp.vfpnum' value='`$tmp.vfpnum + 1`' />
+ </set>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].vf-module-id`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-id`"/>
+ <parameter name="tmp.vfpnum" value='0'/>
+ </set>
+ <for index='m' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].value`"/>
+ <parameter name='tmp.pvnfrnum' value='0' />
+ </set>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key_length == ''`">
+ <outcome value='false'>
+ <for index='n' start='0' end='`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key_length`' >
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].resource-resolution-data.resource-key[$tmp.pvnfrnum].name`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key[$n].name`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].resource-resolution-data.resource-key[$tmp.pvnfrnum].value`' value="`$service-data.vnfs.vnf[$i].vnf-data.vf-modules.vf-module[$ln].vf-module-data.vf-module-topology.vf-module-parameters.param[$m].resource-resolution-data.resource-key[$n].value`"/>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param[$tmp.vfpnum].resource-resolution-data.resource-key_length`' value='`$tmp.pvnfrnum + 1`' />
+ <parameter name='tmp.pvnfrnum' value='`$tmp.pvnfrnum + 1`' />
+ </set>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='`vnf-get-resource-request-output.vnf-get-resource-response-information.vnf[$tmp.vnf_counter].vf-module[$tmp.vf_counter].param_length`' value='`$tmp.vfpnum + 1`' />
+ <parameter name='tmp.vfpnum' value='`$tmp.vfpnum + 1`' />
+ </set>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='vnf-get-resource-request-output.vnf-get-resource-response-information.vnf_length' value='`$tmp.vnf_counter + 1`' />
+ <parameter name='tmp.vnf_counter' value='`$tmp.vnf_counter + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <return status="success">
+ <parameter name="error-code" value="200" />
+ </return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-activate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-activate.xml
index 2c2d73da..6d5aacd3 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-activate.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-activate.xml
@@ -1,70 +1,84 @@
-<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='vnf-topology-operation-activate' mode='sync'>
-<block atomic="true"><switch test='`$vnf-topology-operation-input.request-information.request-action`'>
-<outcome value='CreateVnfInstance'>
-<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 'activate' then request-action must be 'CreateVnfInstance'" />
-</return></outcome></switch><switch test='`$service-data.vnfs.vnf_length`'>
-<outcome value=''>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="404" />
- <parameter name="error-message" value="There are no VNFs in MD-SAL" />
-</return></outcome></switch><for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
-<switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`'>
-<outcome value='true'>
-<set>
-<parameter name='vnf-index' value='`$idx`' />
-</set></outcome></switch></for><switch test='`$vnf-index`'>
-<outcome value=''>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="404" />
- <parameter name="error-message" value="'Could not find VNF ' + $vnf-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 == 'PendingCreate'`">
-<outcome value='false'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'Order status must be PendingCreate, but is currently '
- + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status`" />
-</return></outcome></switch><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+<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='vnf-topology-operation-activate' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateVnfInstance'>
+ <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 'activate' then request-action must be 'CreateVnfInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="There are no VNFs in MD-SAL" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vnf-index`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="'Could not find VNF ' + $vnf-topology-operation-input.vnf-information.vnf-id + ' in MD-SAL'" />
+ </return>
+ </outcome>
+ </switch>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="generic-vnf"
key="generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-id"
force="true" pfx="tmp.AnAI-data">
-<parameter name="prov-status" value="NVTPROV" />
-<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 generic-vnf in AAI" />
-</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 generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
-</return></outcome></update><set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.' value='$vnf-topology-operation-input.vnf-information.' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.' value='$vnf-topology-operation-input.vnf-request-input.' />
-
-</set><set>
-<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
- + $tunnelxconn-topology-operation-input.service-information.service-instance-id
- + '/service-data/service-topology/'`"/>
-</set><set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='Created' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
-</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
-<parameter name='filename' value='/var/tmp/vnf-top-act.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>
+ <parameter name="prov-status" value="NVTPROV" />
+ <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 generic-vnf in AAI" />
+ </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 generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
+ </return>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.' value='$vnf-topology-operation-input.vnf-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.' value='$vnf-topology-operation-input.vnf-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='Created' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-assign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-assign.xml
index 27419ac3..232d0c51 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-assign.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-assign.xml
@@ -1,386 +1,1026 @@
-<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='vnf-topology-operation-assign' mode='sync'>
-<block atomic="true"><switch test='`$vnf-topology-operation-input.request-information.request-action`'>
-<outcome value='CreateVnfInstance'>
-<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 'CreateVnfInstance'" />
-</return></outcome></switch><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+<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='vnf-topology-operation-assign' mode='sync'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateVnfInstance'>
+ <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 'CreateVnfInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key='SELECT * from VF_MODEL WHERE customization_uuid = $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid'
pfx='db.vf-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_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 VNF customization UUID ' + $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`" />
-</return></outcome></get-resource><switch test='`$service-data.vnfs.vnf_length`'>
-<outcome value=''>
-<set>
-<parameter name='vnf-index' value='0' />
-</set></outcome><outcome value='Other'>
-<block>
-<set>
-<parameter name='vnf-index' value='`$service-data.vnfs.vnf_length`' />
-</set><for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
-<switch test='`$vnf-topology-operation-input.vnf-information.vnf-id == $service-data.vnfs.vnf[$idx].vnf-id`'>
-<outcome value='true'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'VNF id ' + $service-data.vnfs.vnf[$idx].vnf-id
- + ' already exists, and has order status ' + $service-data.vnfs.vnf[$idx].vnf-data.vnf-level-oper-status.order-status`" />
-</return></outcome></switch></for></block></outcome></switch><set>
-<parameter name='service-data.vnfs.vnf_length' value='`$vnf-index + 1`' />
-</set><set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-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 reading VF_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 VNF customization UUID ' + $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.exist.sdnc-model-name' value='false' />
+ <parameter name='tmp.exist.sdnc-artifact-name' value='false' />
+ </set>
+ <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`">
+ <outcome value=''>
+ <set>
+ <parameter name='vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for silentFailure='true' index='p' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`' >
+ <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$p].name`">
+ <outcome value='sdnc_model_name'>
+ <set>
+ <parameter name='tmp.exist.sdnc-model-name' value='true' />
+ </set>
+ </outcome>
+ <outcome value='sdnc_artifact_name'>
+ <set>
+ <parameter name='tmp.exist.sdnc-artifact-name' value='true' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.exist.sdnc-model-name == 'true' and $tmp.exist.sdnc-artifact-name == 'true'`">
+ <outcome value='true'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-assign' 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="`'Failed to create self-serve assignment for vnf with vnf-id=' + $vnf-topology-operation-input.vnf-information.vnf-id`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='PendingCreate' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-vnfend.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>
+ </outcome>
+ <outcome value='false'>
+ <switch test="`$db.vf-model.sdnc-model-name != '' and $db.vf-model.sdnc-artifact-name != ''`">
+ <outcome value='true'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-assign' 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="`'Failed to create self-serve assignment for vnf with vnf-id=' + $vnf-topology-operation-input.vnf-information.vnf-id`" />
+ </return>
+ </outcome>
+ </call>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='PendingCreate' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/ss-vnfend.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>
+ </outcome>
+ <outcome value='false'>
+ <block atomic="true">
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='vnf-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='`$service-data.vnfs.vnf_length`' />
+ </set>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$vnf-topology-operation-input.vnf-information.vnf-id == $service-data.vnfs.vnf[$idx].vnf-id`'>
+ <outcome value='true'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'VNF id ' + $service-data.vnfs.vnf[$idx].vnf-id
+ + ' already exists'`" />
+ </return>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf_length' value='`$vnf-index + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.vnf-network-collection_length' value='0' />
+ </set>
+ <for silentFailure='true' index='inst-group-index' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids_length`' >
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="instance-group"
+ key="instance-group.id = $vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids[$inst-group-index].vnf-network-instance-group-id"
+ pfx='aai.instance-group' 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="`'Cannot find instance group id ' +
+ $vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids[$inst-group-index].vnf-network-instance-group-id
+ + ' 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 instance-group from AAI" />
+ </return>
+ </outcome>
+ </get-resource>
+ <for index='rel-index' start='0' end='`$aai.instance-group.relationship-list.relationship_length`' >
+ <switch test='`$aai.instance-group.relationship-list.relationship[$rel-index].related-to`'>
+ <outcome value='collection'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="collection"
+ key="collection.collection-id = $aai.instance-group.relationship-list.relationship[$rel-index].relationship-data[0].relationship-value"
+ pfx='aai.collection' 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="`'Cannot find collection ' +
+ $aai.instance-group.relationship-list.relationship[$rel-index].relationship-data[0].relationship-value
+ + ' 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="System error retrieving collection from AAI" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-network-instance-group' value='false' />
+ </set>
+ <for silentFailure='true' index='nig-index' start='0' end='`$service-data.network-instance-groups.network-instance-group_length`' >
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids[$inst-group-index].vnf-network-instance-group-id
+ == $service-data.network-instance-groups.network-instance-group[$nig-index].network-instance-group-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='found-network-instance-group' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-network-instance-group`'>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Could not find network instance group ' +
+ $vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids[$inst-group-index].vnf-network-instance-group-id
+ + ' in MD-SAL'`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$tmp.vnf-network-collection_length].network-instance-group-function'
+ value='`$aai.instance-group.instance-group-function`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$tmp.vnf-network-collection_length].network-instance-group-id'
+ value='`$aai.instance-group.id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$tmp.vnf-network-collection_length].network-collection-service-instance-id'
+ value='`$service-data.network-instance-groups.network-instance-group[$nig-index].service-instance-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection[$tmp.vnf-network-collection_length].network-collection-customization-uuid'
+ value='`$aai.collection.collection-customization-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.vnf-network-collection_length' value='`$tmp.vnf-network-collection_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </get-resource>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-network-collections.vnf-network-collection_length'
+ value='`$tmp.vnf-network-collection_length`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-id'
value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-type'
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-type'
value='`$vnf-topology-operation-input.vnf-information.vnf-type`' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-type'
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-type'
value='`$db.vf-model.nf-type`' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-role'
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-role'
value='`$db.vf-model.nf-role`' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-function'
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-function'
value='`$db.vf-model.nf-function`' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-code'
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-code'
value='`$db.vf-model.nf-code`' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.tenant'
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.tenant'
value='`$vnf-topology-operation-input.vnf-request-input.tenant`' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.aic-cloud-region'
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.aic-cloud-region'
value='`$vnf-topology-operation-input.vnf-request-input.aic-cloud-region`' />
-
-</set><switch test='`$vnf-topology-operation-input.vnf-request-input.vnf-name`'>
-<outcome value=''><block atomic="true"><switch test='`$db.vf-model.ecomp-generated-naming`'>
-<outcome value='Y'><block>
-</block></outcome><outcome value='N'><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="No vnf-name was received but ecomp-generated-naming is not Y" />
-</return></outcome><outcome value='Other'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="No vnf-name was received but ecomp-generated-naming is not Y" />
-</return></outcome></switch><set>
-<parameter name='generate-unique-name-input.index-table-name' value='VNF_NAME_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='VNF_INSTANCE' />
-<parameter name='generate-unique-name-input.prefix' value="`'z' + $vnf-topology-operation-input.vnf-request-input.aic-cloud-region + $db.vf-model.nf-code`" />
-<parameter name='generate-unique-name-input.index-length' value='2' />
-</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.vnf-name' value='`$generate-unique-name-output.generated-name`' />
-</set></outcome></call></block></outcome><outcome value='Other'>
-<block atomic="true"><set>
-<parameter name='generate-unique-name-input.name-table-type' value='VNF_INSTANCE' />
-<parameter name='generate-unique-name-input.supplied-name' value='`$vnf-topology-operation-input.vnf-request-input.vnf-name`' />
-</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.vnf-name' value="`$vnf-topology-operation-input.vnf-request-input.vnf-name`" />
-</set></outcome></call></block></outcome></switch><set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-id'
+ </set>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.vnf-name`'>
+ <outcome value=''>
+ <block atomic="true">
+ <switch test='`$db.vf-model.ecomp-generated-naming`'>
+ <outcome value='Y'>
+ <block></block>
+ </outcome>
+ <outcome value='N'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No vnf-name was received but ecomp-generated-naming is not Y" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No vnf-name was received but ecomp-generated-naming is not Y" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$db.vf-model.naming-policy`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name='generate-unique-name-input.action' value='ASSIGN' />
+ <parameter name='generate-unique-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='generate-unique-name-input.index-table-name' value='VNF_NAME_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='VNF_INSTANCE' />
+ <parameter name='generate-unique-name-input.prefix' value="`'z' + $vnf-topology-operation-input.vnf-request-input.aic-cloud-region + $db.vf-model.nf-code`" />
+ </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.vnf-name' value='`$generate-unique-name-output.generated-name`' />
+ </set>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.policy-instance-name' value='`$db.vf-model.naming-policy`' />
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='ASSIGN' />
+ <parameter name='naming-policy-generate-name-input.query-parameter' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-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="Unable to generate VNF name" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.vnf-name' value='`$naming-policy-generate-name-output.vnf-name`' />
+ </set>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.vnf-name' value="`$vnf-topology-operation-input.vnf-request-input.vnf-name`" />
+ </set>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vnf.log' />
+ </execute>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-id'
value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
-</set><set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-name'
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-name'
value='`$tmp.vnf-name`' />
-</set><switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`'>
-<outcome value=''><set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-invariant-uuid'
+ </set>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-invariant-uuid'
value='`$db.vf-model.invariant-uuid`' />
-</set></outcome><outcome value='Other'>
-<set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-invariant-uuid'
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-invariant-uuid'
value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`' />
-</set></outcome></switch><switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`'>
-<outcome value=''><set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-uuid'
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-uuid'
value='`$db.vf-model.uuid`' />
-</set></outcome><outcome value='Other'>
-<set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-uuid'
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-uuid'
value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`' />
-</set></outcome></switch><switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-version`'>
-<outcome value=''><set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-version'
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-version`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-version'
value='`$db.vf-model.version`' />
-</set></outcome><outcome value='Other'>
-<set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-version'
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-version'
value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-version`' />
-</set></outcome></switch><switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-name`'>
-<outcome value=''><set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-name'
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-name`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-name'
value='`$db.vf-model.name`' />
-</set></outcome><outcome value='Other'>
-<set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-name'
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-name'
value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-name`' />
-</set></outcome></switch><set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-customization-uuid'
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-customization-uuid'
value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`' />
-</set><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="cloud-region"
- key="cloud-region.cloud-owner = 'CloudOwner' AND
+ key="cloud-region.cloud-owner = $prop.cloud-region.cloud-owner AND
cloud-region.cloud-region-id = $vnf-topology-operation-input.vnf-request-input.aic-cloud-region AND
- depth='0'"
+ depth='all'"
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.vnf-topology.aic-clli'
+ <outcome value='not-found'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <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>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <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>
+ </block>
+ </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.vnf-topology.aic-clli'
value='`$aai-uid-split[$aai-uid-split_length - 1]`' />
-</set><break>
-</break></block></outcome></switch></for><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="availability-zones"
- key="cloud-region.cloud-owner = 'CloudOwner' AND
- cloud-region.cloud-region-id = $vnf-topology-operation-input.vnf-request-input.aic-cloud-region AND
- depth='0'"
- pfx='aai.az' local-only='false' >
-
-<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 availability zones from AAI" />
-</return></outcome></get-resource><switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-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 ' + $vnf-topology-operation-input.vnf-request-input.aic-cloud-region`" />
-</return></outcome></switch><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.aic-clli`'>
+ <outcome value=''>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <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 ' + $vnf-topology-operation-input.vnf-request-input.aic-cloud-region`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key='SELECT * from VF_TO_NETWORK_ROLE_MAPPING WHERE vf_customization_uuid = $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid'
pfx='db.vf-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 VF_TO_NETWORK_ROLE_MAPPING table" />
-</return></outcome><outcome value='not-found'>
-<set>
-<parameter name='db.vf-network-role-mapping_length' value='0' />
-</set></outcome></get-resource><set>
-<parameter name='network-index' value='0' />
-</set><for index='role-index' start='0' end='`$db.vf-network-role-mapping_length`'><block atomic="true"><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_TO_NETWORK_ROLE_MAPPING table" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <set>
+ <parameter name='db.vf-network-role-mapping_length' value='0' />
+ </set>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='network-index' value='0' />
+ </set>
+ <for index='role-index' start='0' end='`$db.vf-network-role-mapping_length`'>
+ <block atomic="true">
+ <set>
+ <parameter name='aai.l3-network.' value='' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="l3-networks"
key="l3-network.network-role = $db.vf-network-role-mapping[$role-index].network-role"
pfx='aai.l3-network' 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="`'No active l3-network found in AAI with cloud_region_id '
+ <outcome value='not-found'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No active l3-network found in AAI with cloud_region_id '
+ $vnf-topology-operation-input.vnf-request-input.aic-cloud-region + ' and network_role '
+ $db.vf-network-role-mapping[$network-index].network-role`" />
-</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 l3-network from AAI" />
-</return></outcome></get-resource><set>
-<parameter name='l3-network-id' value='-1' />
-</set><block>
-<for index='db-network-index' start='0' end='`$aai.l3-network.l3-network_length`' >
-<switch test='`$aai.l3-network.l3-network[$db-network-index].orchestration-status`'>
-<outcome value='PendingCreate'>
-<block>
-</block></outcome><outcome value='Pending Create'>
-<block>
-</block></outcome><outcome value='PendingDelete'>
-<block>
-</block></outcome><outcome value='Pending Delete'>
-<block>
-</block></outcome><outcome value='Other'>
-<for silentFailure='true' index='db-rel-index' start='0' end='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship_length`' >
-<switch test='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].related-to`'>
-<outcome value='cloud-region'>
-<for silentFailure='true' index='db-data-index' start='0' end='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data_length`' >
-<switch test='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data[$db-data-index].relationship-key`'>
-<outcome value='cloud-region.cloud-region-id'>
-<switch test='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data[$db-data-index].relationship-value == $vnf-topology-operation-input.vnf-request-input.aic-cloud-region`'>
-<outcome value='true'>
-<block atomic="true"><set>
-<parameter name='l3-network-id' value='`$aai.l3-network.l3-network[$db-network-index].network-id`' />
-</set><return status='failure'>
-</return></block></outcome></switch></outcome></switch></for></outcome></switch></for></outcome></switch></for><return status='success'>
-
-</return></block><switch test='`$l3-network-id`'>
-<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 l3-network in AAI for network role ' + $db.vf-network-role-mapping[$role-index].network-role`" />
-</return></outcome></switch><set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].network-role'
+ </return>
+ </block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error retrieving l3-network from AAI" />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='l3-network-id' value='-1' />
+ </set>
+ <block>
+ <set>
+ <parameter name='found-network' value='false' />
+ </set>
+ <for index='db-network-index' start='0' end='`$aai.l3-network.l3-network_length`' >
+ <block atomic="true">
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].orchestration-status`'>
+ <outcome value='PendingCreate'>
+ <block></block>
+ </outcome>
+ <outcome value='Pending Create'>
+ <block></block>
+ </outcome>
+ <outcome value='PendingDelete'>
+ <block></block>
+ </outcome>
+ <outcome value='Pending Delete'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <for silentFailure='true' index='db-rel-index' start='0' end='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship_length`' >
+ <block atomic="true">
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].related-to`'>
+ <outcome value='cloud-region'>
+ <for silentFailure='true' index='db-data-index' start='0' end='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data_length`' >
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data[$db-data-index].relationship-key`'>
+ <outcome value='cloud-region.cloud-region-id'>
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data[$db-data-index].relationship-value == $vnf-topology-operation-input.vnf-request-input.aic-cloud-region`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='l3-network-id' value='`$aai.l3-network.l3-network[$db-network-index].network-id`' />
+ </set>
+ <set>
+ <parameter name='found-network' value='true' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$found-network`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$found-network`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ <switch test='`$l3-network-id`'>
+ <outcome value='-1'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find l3-network in AAI for network role ' + $db.vf-network-role-mapping[$role-index].network-role`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].network-role'
value='`$db.vf-network-role-mapping[$role-index].network-role`' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].network-name'
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].network-name'
value='`$aai.l3-network.l3-network[$db-network-index].network-name`' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].neutron-id'
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].neutron-id'
value='`$aai.l3-network.l3-network[$db-network-index].neutron-network-id`' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].network-id'
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].network-id'
value='`$aai.l3-network.l3-network[$db-network-index].network-id`' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].contrail-network-fqdn'
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].contrail-network-fqdn'
value='`$aai.l3-network.l3-network[$db-network-index].contrail-network-fqdn`' />
-</set><for index='subnet-index' start='0' end='`$aai.l3-network.l3-network[0].subnets.subnet_length`' >
-<set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].ip-version'
- value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].ip-version`' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].subnet-id'
+ </set>
+ <switch test='`$aai.l3-network.l3-network[0].subnets.subnet_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data_length'
+ value='0' />
+ </set>
+ </outcome>
+ <outcome value='0'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data_length'
+ value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <for index='subnet-index' start='0' end='`$aai.l3-network.l3-network[0].subnets.subnet_length`' >
+ <block>
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].subnet-role`'>
+ <outcome value=''>
+ <set>
+ <parameter name='aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].subnet-role' value='NONE' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].ip-version`'>
+ <outcome value='4'>
+ <set>
+ <parameter name='tmp.ip-version' value='ipv4' />
+ </set>
+ </outcome>
+ <outcome value='6'>
+ <set>
+ <parameter name='tmp.ip-version' value='ipv6' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].ip-version'
+ value='`$tmp.ip-version`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].subnet-id'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].neutron-subnet-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].sdnc-subnet-id'
value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].subnet-id`' />
-</set></for><set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data_length'
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].subnet-role'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].subnet-role`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].subnet-name'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].subnet-name`' />
+ </set>
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].dhcp-enabled`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].dhcp-enabled'
+ value='Y' />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data[$subnet-index].dhcp-enabled'
+ value='N' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].subnets-data.subnet-data_length'
value='`$aai.l3-network.l3-network[0].subnets.subnet_length`' />
-</set><set>
-<parameter name='network-index' value='`$network-index + 1`' />
-</set></block></for><set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length'
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='network-index' value='`$network-index + 1`' />
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length'
value='`$network-index`' />
-</set><set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.'
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.'
value='vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.' />
-</set><switch test='`$aai.az.availability-zone_length`'>
-<outcome value=''><switch test='`$db.vf-model.avail-zone-max-count &gt; 0`'>
-<outcome value='true'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'No availability zones found in AAI for cloud region '
+ </set>
+ <switch test='`$aai.cloud-region.availability-zones.availability-zone_length`'>
+ <outcome value=''>
+ <switch test='`$db.vf-model.avail-zone-max-count &gt; 0`'>
+ <outcome value='true'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No availability zones found in AAI for cloud region '
+ $vnf-topology-operation-input.vnf-request-input.aic-cloud-region`" />
-</return></outcome><outcome value='false'>
-<set>
-<parameter name='aai.az.availability-zone_length' value='0' />
-</set></outcome></switch></outcome></switch><for index='idx' start='0' end='`$aai.az.availability-zone_length`' >
-<block atomic="true"><set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone[$idx]'
- value='`$aai.az.availability-zone[$idx].availability-zone-name`' />
-</set><save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ </return>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='aai.cloud-region.availability-zones.availability-zone_length' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <for index='idx' start='0' end='`$aai.cloud-region.availability-zones.availability-zone_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone[$idx]'
+ value='`$aai.cloud-region.availability-zones.availability-zone[$idx].availability-zone-name`' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="generic-vnf:relationship-list"
key="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="availability-zone" />
- <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="cloud-region.cloud-owner" />
- <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="CloudOwner" />
- <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-key" value="cloud-region.cloud-region-id" />
- <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-value" value="`$vnf-topology-operation-input.vnf-request-input.aic-cloud-region`" />
- <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-key" value="availability-zone.availability-zone-name" />
- <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-value" value="`$aai.az.availability-zone[$idx].availability-zone-name`" />
-<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 generic-vnf in AAI" />
-</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 generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
-</return></outcome></save></block></for><set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.availability-zones.max-count'
+ <parameter name="relationship-list.relationship[0].related-to" value="availability-zone" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="cloud-region.cloud-owner" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$prop.cloud-region.cloud-owner`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-key" value="cloud-region.cloud-region-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-value" value="`$vnf-topology-operation-input.vnf-request-input.aic-cloud-region`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-key" value="availability-zone.availability-zone-name" />
+ <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-value" value="`$aai.cloud-region.availability-zones.availability-zone[$idx].availability-zone-name`" />
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating generic-vnf in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.availability-zones.max-count'
value='`$db.vf-model.avail-zone-max-count`' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone_length'
- value='`$aai.az.availability-zone_length`' />
-</set><for index='vnf-nw-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
-<block atomic="true"><save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.availability-zones.availability-zone_length'
+ value='`$aai.cloud-region.availability-zones.availability-zone_length`' />
+ </set>
+ <for index='vnf-nw-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="generic-vnf:relationship-list"
key="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="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-nw-index].network-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 generic-vnf in AAI" />
-</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 generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
-</return></outcome></save></block></for><set>
-<parameter name='vnf-object-path'
+ <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="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-nw-index].network-id`" />
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating generic-vnf in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ <set>
+ <parameter name='vnf-object-path'
value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ $vnf-topology-operation-input.service-information.service-instance-id
+ '/service-data/vnfs/vnf/'
+ $service-data.vnfs.vnf[$vnf-index].vnf-id
+ '/vnf-data/vnf-topology'`"/>
-<parameter name='service-object-path'
- value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
- + $vnf-topology-operation-input.service-information.service-instance-id
- + '/service-data/vnfs/vnf/'
- + $service-data.vnfs.vnf[$vnf-index].vnf-id
- + '/vnf-data/vnf-topology'`"/></set><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="generic-vnf"
key="generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-id"
force="true" pfx="tmp.AnAI-data">
-<parameter name="vnf-name" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-name`" />
-<parameter name="prov-status" value="PREPROV" />
-<parameter name="operational-status" value="out-of-service-path" />
-<parameter name="equipment-role" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-role`" />
-<parameter name="model-invariant-id" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-invariant-uuid`" />
-<parameter name="model-version-id" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-uuid`" />
-<parameter name="model-customization-id" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-customization-uuid`" />
-<parameter name="selflink" value="`$vnf-object-path`" />
-<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 selflink in generic-vnf in AAI" />
-</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 generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
-</return></outcome></update><set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.' value='$vnf-topology-operation-input.vnf-information.' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.' value='$vnf-topology-operation-input.vnf-request-input.' />
-
-</set><set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='PendingCreate' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
-</set><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>
+ <parameter name="vnf-name" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-name`" />
+ <parameter name="prov-status" value="PREPROV" />
+ <!-- <parameter name="operational-status" value="out-of-service-path" /> -->
+ <parameter name="equipment-role" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.nf-role`" />
+ <parameter name="model-invariant-id" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-invariant-uuid`" />
+ <parameter name="model-version-id" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-uuid`" />
+ <parameter name="model-customization-id" value="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.model-customization-uuid`" />
+ <parameter name="selflink" value="`$vnf-object-path`" />
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating selflink in generic-vnf in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
+ </return>
+ </block>
+ </outcome>
+ </update>
+ <for silentFailure='true' index='inst-group-index' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf:relationship-list"
+ key="generic-vnf.vnf-id = $vnf-topology-operation-input.vnf-information.vnf-id"
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="instance-group" />
+ <parameter name="relationship-list.relationship[0].related-link"
+ value="`'/aai/v$/network/instance-groups/instance-group/'
+ + $vnf-topology-operation-input.vnf-request-input.vnf-network-instance-group-ids[$inst-group-index].vnf-network-instance-group-id`" />
+ <outcome value='failure'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating relationship in generic-vnf in AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='not-found'>
+ <block>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.' value='$vnf-topology-operation-input.vnf-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.' value='$vnf-topology-operation-input.vnf-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='PendingCreate' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-viprend.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>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-changeassign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-changeassign.xml
new file mode 100755
index 00000000..5823f6ba
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-changeassign.xml
@@ -0,0 +1,81 @@
+<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='vnf-topology-operation-changeassign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateVnfInstance'>
+ <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 'changeassign' then request-action must be 'CreateVnfInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="There are no VNFs in MD-SAL" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vnf-index`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="'Could not find VNF ' + $vnf-topology-operation-input.vnf-information.vnf-id + ' in MD-SAL'" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODEL WHERE customization_uuid = $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid'
+ pfx='db.vf-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_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 VNF customization UUID ' + $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.'
+ value='`$vnf-topology-operation-input.vnf-information.onap-model-information.`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='Created' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <set>
+ <parameter name='service-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $service-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <return status='success'></return>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-deactivate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-deactivate.xml
index 5d5bde09..76654869 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-deactivate.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-deactivate.xml
@@ -1,57 +1,84 @@
-<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='vnf-topology-operation-deactivate' mode='sync'>
-<block atomic="true"><switch test='`$vnf-topology-operation-input.request-information.request-action`'>
-<outcome value='DeleteVnfInstance'>
-<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 'deactivate' then request-action must be 'DeleteVnfInstance'" />
-</return></outcome></switch><switch test='`$service-data.vnfs.vnf_length`'>
-<outcome value=''>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="404" />
- <parameter name="error-message" value="There are no VNFs in MD-SAL" />
-</return></outcome></switch><for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
-<switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`'>
-<outcome value='true'>
-<set>
-<parameter name='vnf-index' value='`$idx`' />
-</set></outcome></switch></for><switch test='`$vnf-index`'>
-<outcome value=''>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="404" />
- <parameter name="error-message" value="'Could not find VNF ' + $vnf-topology-operation-input.vnf-information.vnf-id + ' in MD-SAL'" />
-</return></outcome></switch><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+<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='vnf-topology-operation-deactivate' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteVnfInstance'>
+ <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 'deactivate' then request-action must be 'DeleteVnfInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="There are no VNFs in MD-SAL" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vnf-index`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="'Could not find VNF ' + $vnf-topology-operation-input.vnf-information.vnf-id + ' in MD-SAL'" />
+ </return>
+ </outcome>
+ </switch>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="generic-vnf"
key="generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-topology-identifier-structure.vnf-id"
force="true" pfx="tmp.AnAI-data">
-<parameter name="orchestration-status" value="PendingDelete" />
-<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 generic-vnf in AAI" />
-</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 generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
-</return></outcome></update><set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.' value='$vnf-topology-operation-input.vnf-information.' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.' value='$vnf-topology-operation-input.vnf-request-input.' />
-
-</set><set>
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='PendingDelete' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
-<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
-</set><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>
+ <parameter name="orchestration-status" value="PendingDelete" />
+ <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 generic-vnf in AAI" />
+ </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 generic-vnf found in AAI for vnf ID ' + $service-data.vnfs.vnf[$vnf-index].vnf-id`" />
+ </return>
+ </outcome>
+ </update>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.' value='$vnf-topology-operation-input.vnf-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.' value='$vnf-topology-operation-input.vnf-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='PendingDelete' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-unassign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-unassign.xml
index 4cf91569..a50fa7d9 100755
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-unassign.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-unassign.xml
@@ -1,64 +1,126 @@
-<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='vnf-topology-operation-unassign' mode='sync'>
-<block atomic="true"><switch test='`$vnf-topology-operation-input.request-information.request-action`'>
-<outcome value='DeleteVnfInstance'>
-<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 'deactivate' then request-action must be 'DeleteVnfInstance'" />
-</return></outcome></switch><switch test='`$service-data.vnfs.vnf_length`'>
-<outcome value=''>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="404" />
- <parameter name="error-message" value="There are no VNFs in MD-SAL" />
-</return></outcome></switch><for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
-<switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`' >
-<outcome value='true'>
-<set>
-<parameter name='vnf-index' value='`$idx`' />
-</set></outcome></switch></for><switch test='`$vnf-index`'>
-<outcome value=''>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="404" />
- <parameter name="error-message" value="'Could not find VNF ' + $vnf-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 == 'Created'`">
-<outcome value='true'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Cannot delete a VNF in a Created state" />
-</return></outcome></switch><switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`">
-<outcome value='0'>
-<block>
-</block></outcome><outcome value=''><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="Cannot delete the VNF because there are VFs defined" />
-</return></outcome></switch><switch test='`$service-data.vnfs.vnf_length`'>
-<outcome value='1'>
-<set>
- <parameter name="service-data.vnfs." value=""/>
-
-</set></outcome><outcome value='Other'>
-<block atomic="true"><for index='idx' start='`$vnf-index + 1`' end='`$service-data.vnfs.vnf_length`' >
-<set>
- <parameter name="$tmpidx" value="`$idx - 1`"/>
- <parameter name="service-data.vnfs.vnf[$tmpidx]." value="$service-data.vnfs.vnf[$idx]." />
-
-</set></for><set>
- <parameter name="service-data.vnfs.vnf[$service-data.vnfs.vnf_length-1]." value=""/>
-
-</set><set>
- <parameter name="service-data.vnfs.vnf_length" value="`$service-data.vnfs.vnf_length - 1`"/>
-
-
-</set></block></outcome></switch><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>
+<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='vnf-topology-operation-unassign' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteVnfInstance'>
+ <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 'deactivate' then request-action must be 'DeleteVnfInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="There are no VNFs in MD-SAL" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`' >
+ <outcome value='true'>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vnf-index`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="'Could not find VNF ' + $vnf-topology-operation-input.vnf-information.vnf-id + ' in MD-SAL'" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`">
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value=''>
+ <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="Cannot delete the VNF because there are VFs defined" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.sdnc-generated-cloud-resources`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-unassign' mode='sync' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value="`'Encountered error while unassigning self-serve resources with error: '+ $error-message`" />
+ </return>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value='1'>
+ <set>
+ <parameter name="service-data.vnfs." value=""/>
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='idx' start='`$vnf-index + 1`' end='`$service-data.vnfs.vnf_length`' >
+ <set>
+ <parameter name="$tmpidx" value="`$idx - 1`"/>
+ <parameter name="service-data.vnfs.vnf[$tmpidx]." value="$service-data.vnfs.vnf[$idx]." />
+ </set>
+ </for>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$service-data.vnfs.vnf_length-1]." value=""/>
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf_length" value="`$service-data.vnfs.vnf_length - 1`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.sdnc-generated-cloud-resources`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name='naming-policy-generate-name-input.naming-type' value='VNF' />
+ <parameter name='naming-policy-generate-name-input.context-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='naming-policy-generate-name-input.action' value='DELETE' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='naming-policy-generate-name' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation.xml
index 669ed75d..15b31e13 100644
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation.xml
@@ -1,77 +1,38 @@
-<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='vnf-topology-operation' mode='sync'>
- <block atomic="true">
- <call module='GENERIC-RESOURCE-API' rpc='validate-vnf-input' mode='sync' ></call>
- <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-action`'>
- <outcome value='assign'>
- <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-assign' mode='sync' ></call>
- </outcome>
- <outcome value='activate'>
- <block atomic="true">
- <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
- <outcome value='ActivateSiteInstance'>
- <call module='GENERIC-RESOURCE-API' rpc='sotn-vnf-topology-operation-activate' mode='sync' ></call>
- </outcome>
- <outcome value='Other'>
- <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-activate' mode='sync' ></call>
- </outcome>
- </switch>
- </block>
- </outcome>
- <outcome value='deactivate'>
- <block atomic="true">
- <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
- <outcome value='DeActivateSiteInstance'>
- <call module='GENERIC-RESOURCE-API' rpc='sotn-vnf-topology-operation-deactivate' mode='sync' ></call>
- </outcome>
- <outcome value='Other'>
- <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-deactivate' mode='sync' ></call>
- </outcome>
- </switch>
- </block>
- </outcome>
- <outcome value='unassign'>
- <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-unassign' mode='sync' ></call>
- </outcome>
- <outcome value='create'>
- <block atomic="true">
- <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
- <outcome value='CreateSiteInstance'>
- <call module='GENERIC-RESOURCE-API' rpc='sotn-vnf-topology-operation-create' mode='sync' ></call>
- </outcome>
- <outcome value='Other'>
- <block></block>
- </outcome>
- </switch>
- </block>
- </outcome>
- <outcome value='delete'>
- <block atomic="true">
- <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
- <outcome value='DeleteSiteInstance'>
- <call module='GENERIC-RESOURCE-API' rpc='sotn-vnf-topology-operation-delete' mode='sync' ></call>
- </outcome>
- <outcome value='Other'>
- <block></block>
- </outcome>
- </switch>
- </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-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
- </return>
- </outcome>
- </switch>
- <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>
+<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='vnf-topology-operation' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-vnf-input' mode='sync' ></call>
+ <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='assign'>
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-assign' mode='sync' ></call>
+ </outcome>
+ <outcome value='activate'>
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='deactivate'>
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='unassign'>
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-unassign' mode='sync' ></call>
+ </outcome>
+ <outcome value='changeassign'>
+ <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-changeassign' mode='sync' ></call>
+ </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-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
+ </return>
+ </outcome>
+ </switch>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/SUBNET-API_managed-network-notification.xml b/platform-logic/generic-resource-api/src/main/xml/SUBNET-API_managed-network-notification.xml
index 4eff2d0f..1654a839 100755
--- a/platform-logic/generic-resource-api/src/main/xml/SUBNET-API_managed-network-notification.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/SUBNET-API_managed-network-notification.xml
@@ -1,92 +1,138 @@
-<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='SUBNET-API' version='${project.version}'><method rpc='managed-network-notification' mode='sync'>
-<block><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="managed-network-notification"/>
-<parameter name="field3" value="`$managed-network-notification-input.request-id`"/>
-<parameter name="field4" value="`$managed-network-notification-input.managed-network-status.status.code`"/>
-<parameter name="field5" value="`$managed-network-notification-input.managed-network-status.status.description`"/>
-<parameter name="field6" value="`$managed-network-notification-input.managed-network-status.final-notification-indicator`"/>
-
-</record><switch test="`$managed-network-notification-input.managed-network-status.status.code`">
-
-<outcome value="Success"><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="activateSubnet">
-
-<outcome value="success"><block><save plugin="com.att.sdnctl.sli.resource.gamma.GammaResource" resource="eipam-ip-subnets"
- key="entity-id = $eipam-ip-block.entity-id" force="true">
- <parameter name="status" value="ACTIVE" />
-
-</save><set>
- <parameter name="eipam-ip-block.status" value="ACTIVE" /></set><save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block">
- <parameter name="eipam-ip-block.status" value="ACTIVE" /></save><execute plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' method='setStatusMethod' >
-<parameter name="key1" value="SUCCESS: eipam-ip-block.status is ACTIVE."/></execute><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="vpe" key="vnf-id = $data-change-notification-input.key-data[0].key-value" pfx="vpe-after">
- <parameter name="operational-state" value="SDNC_COMPLETED" />
- <parameter name="summary-status" value="`$aai-summary-status-message`" />
-</update> <return status="success">
-
-</return></block></outcome><outcome value="Other">
-
-<block><save plugin="com.att.sdnctl.sli.resource.gamma.GammaResource" resource="eipam-ip-subnets"
- key="entity-id = $eipam-ip-block.entity-id" force="true">
- <parameter name="status" value="ERROR" />
-
-</save><set>
- <parameter name="eipam-ip-block.status" value="ERROR" /></set><save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block">
- <parameter name="eipam-ip-block.status" value="ERROR" /></save><execute plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' method='setStatusMethod' >
-<parameter name="key1" value="ActivateSubnet failure, need to manually activate in EIPAM."/></execute><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="vpe"
- key="vnf-id = $data-change-notification-input.key-data[0].key-value" pfx="vpe-after">
- <parameter name="operational-state" value="EIPAM_ERROR" />
- <parameter name="summary-status" value="`$aai-summary-status-message`" />
- <parameter name="prov-status" value="PREPROV" />
- </update> <return status="failure">
- <parameter name="error-code" value="3000" />
- <parameter name="error-message" value="ActivateSubnet failure, need to manually activate in EIPAM" />
-</return></block></outcome></execute></outcome><outcome value="Other"><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deallocateSubnet">
-
-<outcome value="success"><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePool">
-
-<outcome value="success"><block><set>
- <parameter name="eipam-ip-block.status" value="DELETED" /></set><execute plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' method='setStatusMethod' >
-<parameter name="key1" value="Failure from NCS and deleted pool/subnet in EIPAM."/></execute><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="vpe" key="vnf-id = $data-change-notification-input.key-data[0].key-value" pfx="vpe-after">
- <parameter name="operational-state" value="SDN_C_BACKOUT_ERROR" />
- <parameter name="summary-status" value="`$aai-summary-status-message`" />
- <parameter name="prov-status" value="PREPROV" />
-</update> <return status="failure">
- <parameter name="error-code" value="2000" />
- <parameter name="error-message" value="Failure from NCS and deleted pool/subnet in EIPAM"/>
-
-</return></block></outcome><outcome value="Other">
-
-<block><save plugin="com.att.sdnctl.sli.resource.gamma.GammaResource" resource="eipam-ip-subnets"
- key="entity-id = $eipam-ip-block.entity-id" force="true">
- <parameter name="status" value="DEALLOCATED" />
-
-</save><set>
- <parameter name="eipam-ip-block.status" value="ERROR" /></set><save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block">
- <parameter name="eipam-ip-block.status" value="ERROR" /></save><execute plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' method='setStatusMethod' >
-<parameter name="key1" value="Failure from NCS and deletePool failed in EIPAM, need to manually delete."/></execute><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="vpe"
- key="vnf-id = $data-change-notification-input.key-data[0].key-value" pfx="vpe-after">
- <parameter name="operational-state" value="SDN_C_BACKOUT_ERROR" />
- <parameter name="summary-status" value="`$aai-summary-status-message`" />
- <parameter name="prov-status" value="PREPROV" />
- </update> <return status="failure">
- <parameter name="error-code" value="1000" />
- <parameter name="error-message" value="Failure from NCS and deletePool failed in EIPAM, need to manually delete." />
-</return></block></outcome></execute></outcome><outcome value="Other">
-
-<block><save plugin="com.att.sdnctl.sli.resource.gamma.GammaResource" resource="eipam-ip-subnets"
- key="entity-id = $eipam-ip-block.entity-id" force="true">
- <parameter name="status" value="ERROR" />
-
-</save><set>
- <parameter name="eipam-ip-block.status" value="ERROR" /></set><save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block">
- <parameter name="eipam-ip-block.status" value="ERROR" /></save><execute plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' method='setStatusMethod' >
-<parameter name="key1" value="Failure from NCS and deletePool failed in EIPAM, need to manually delete."/></execute><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="vpe"
- key="vnf-id = $data-change-notification-input.key-data[0].key-value" pfx="vpe-after">
- <parameter name="operational-state" value="SDN_C_BACKOUT_ERROR" />
- <parameter name="summary-status" value="`$aai-summary-status-message`" />
- <parameter name="prov-status" value="PREPROV" />
- </update> <return status="failure">
- <parameter name="error-code" value="1000" />
- <parameter name="error-message" value="Failure from NCS and deletePool failed in EIPAM, need to manually delete." />
-</return></block></outcome></execute></outcome></switch></block></method></service-logic>
+<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='SUBNET-API' version='${project.version}'>
+ <method rpc='managed-network-notification' mode='sync'>
+ <block>
+ <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="managed-network-notification"/>
+ <parameter name="field3" value="`$managed-network-notification-input.request-id`"/>
+ <parameter name="field4" value="`$managed-network-notification-input.managed-network-status.status.code`"/>
+ <parameter name="field5" value="`$managed-network-notification-input.managed-network-status.status.description`"/>
+ <parameter name="field6" value="`$managed-network-notification-input.managed-network-status.final-notification-indicator`"/>
+ </record>
+ <switch test="`$managed-network-notification-input.managed-network-status.status.code`">
+ <outcome value="Success">
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="activateSubnet">
+ <outcome value="success">
+ <block>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * FROM VPE_POOL where vpe_name = $eipam-ip-block.ptnii-name ;"
+ pfx='tmp.vpe-pool-row'></get-resource>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="UPDATE EIPAM_IP_SUBNETS
+ SET status = 'ACTIVE'
+ WHERE entity_id = $eipam-ip-block.entity-id ; "
+ force='true'
+ pfx='pfx.eipam-subnet-row'></save>
+ <set>
+ <parameter name="eipam-ip-block.status" value="ACTIVE" />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block">
+ <parameter name="eipam-ip-block.status" value="ACTIVE" />
+ </save>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="generic-vnf" key="generic-vnf.vnf-id = $tmp.vpe-pool-row.vpe-id" pfx="vpe-after">
+ <parameter name="orchestration-status" value="Activated" />
+ <parameter name="prov-status" value="NVTPROV" />
+ </update>
+ <return status="success"></return>
+ </block>
+ </outcome>
+ <outcome value="Other">
+ <block>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="UPDATE EIPAM_IP_SUBNETS
+ SET status = 'ACTIVATE_ERROR'
+ WHERE entity_id = $eipam-ip-block.entity-id ; "
+ force='true'
+ pfx='pfx.eipam-subnet-row'></save>
+ <set>
+ <parameter name="eipam-ip-block.status" value="ERROR" />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block">
+ <parameter name="eipam-ip-block.status" value="EIPAM_ACTIVATESUBNET_ERROR" />
+ </save>
+ <return status="failure">
+ <parameter name="error-code" value="3000" />
+ <parameter name="error-message" value="ActivateSubnet failure, need to manually activate in EIPAM" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ </outcome>
+ <outcome value="Other">
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deallocateSubnet">
+ <outcome value="success">
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePool">
+ <outcome value="success">
+ <block>
+ <set>
+ <parameter name="eipam-ip-block.status" value="DELETED" />
+ </set>
+ <return status="failure">
+ <parameter name="error-code" value="2000" />
+ <parameter name="error-message" value="Failure from NCS and deleted pool/subnet in EIPAM"/>
+ </return>
+ </block>
+ </outcome>
+ <outcome value="Other">
+ <block>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="UPDATE EIPAM_IP_SUBNETS
+ SET status = 'DEALLOCATED'
+ WHERE entity_id = $eipam-ip-block.entity-id ; "
+ force='true'
+ pfx='pfx.eipam-subnet-row'></save>
+ <set>
+ <parameter name="eipam-ip-block.status" value="ERROR" />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block">
+ <parameter name="eipam-ip-block.status" value="SDN_C_BACKOUT_ERROR" />
+ </save>
+ <return status="failure">
+ <parameter name="error-code" value="1000" />
+ <parameter name="error-message" value="Failure from NCS and deletePool failed in EIPAM, need to manually delete." />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ </outcome>
+ <outcome value="Other">
+ <block>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="UPDATE EIPAM_IP_SUBNETS
+ SET status = 'DEALLOCSUBNET_ERROR'
+ WHERE entity_id = $eipam-ip-block.entity-id ; "
+ force='true'
+ pfx='pfx.eipam-subnet-row'></save>
+ <set>
+ <parameter name="eipam-ip-block.status" value="ERROR" />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block">
+ <parameter name="eipam-ip-block.status" value="SDN_C_BACKOUT_ERROR" />
+ </save>
+ <return status="failure">
+ <parameter name="error-code" value="1000" />
+ <parameter name="error-message" value="Failure from NCS and deletePool failed in EIPAM, need to manually delete." />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/SUBNET-API_subnet-allocated-notification.xml b/platform-logic/generic-resource-api/src/main/xml/SUBNET-API_subnet-allocated-notification.xml
index f5f75cff..c1ed57c2 100755
--- a/platform-logic/generic-resource-api/src/main/xml/SUBNET-API_subnet-allocated-notification.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/SUBNET-API_subnet-allocated-notification.xml
@@ -1,455 +1,626 @@
-<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='SUBNET-API' version='${project.version}'><method rpc='subnet-allocated-notification' mode='sync'>
-<block><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="subnet-allocated-notification"/>
-<parameter name="field3" value="`$eipam-ip-block.request-id`"/>
-<parameter name="field4" value="`$eipam-ip-block.entity-id`"/>
-<parameter name="field5" value="`$eipam-ip-block.ptnii-name`"/>
-<parameter name="field6" value="`$eipam-ip-block.ip-address`"/>
-<parameter name="field7" value="`$eipam-ip-block.prefix-length`"/>
-<parameter name="field8" value="`$eipam-ip-block.status`"/>
-<parameter name="field9" value="`$tmp.key-value`"/></record><!--Need to know which ipv version to get the plan name from the network-model.--><switch test="`$eipam-ip-block.ptnii-name`"><!--If there's ptnii-name, then it's Gamma service--><outcome value='Other'><configure adaptor="com.att.sdnctl.sli.adaptor.ncs.ncsAdaptor" key="SNIIR" activate="true">
- <parameter name="input.request-id" value="`$eipam-ip-block.request-id`" />
- <parameter name="input.source" value="SDNC" />
- <parameter name="input.ptnii-name" value="`$eipam-ip-block.ptnii-name`" />
- <parameter name="input.ip-address" value="`$eipam-ip-block.ip-address`" />
- <parameter name="input.mask" value="`$eipam-ip-block.prefix-length`" /><outcome value="success">
-<block><save
- plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
- resource='SQL'
- key="UPDATE EIPAM_IP_SUBNETS
- SET status = 'PENDING-ACTIVE'
- WHERE entity_id = $eipam-ip-block.entity-id ; "
- force='true'
- pfx='pfx.eipam-subnet-row'>
-</save><set>
- <parameter name="eipam-ip-block.status" value="PENDING-ACTIVE" /></set><save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block">
- <parameter name="eipam-ip-block.status" value="PENDING-ACTIVE" /></save> <return status="success">
-
-</return></block></outcome><outcome value="Other">
-
-<!--subnet and subnet_keys are deleted in the EIPAMPlugin--><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePool">
-
-<outcome value="success">
-<block><set>
- <parameter name="eipam-ip-block.status" value="DELETED" /></set><execute plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' method='setStatusMethod' >
-<parameter name="key1" value="IpBlockInstall failure and pool deleted in EIPAM."/>
-</execute><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="vpe" key="vnf-id = $data-change-notification-input.key-data[0].key-value" pfx="vpe-after">
- <parameter name="operational-state" value="NCS_IP_SUBNET_INSTALL_ERROR" />
- <parameter name="summary-status" value="`$aai-summary-status-message`" />
- <parameter name="prov-status" value="PREPROV" />
-</update> <return status="failure">
- <parameter name="error-code" value="1000" />
- <parameter name="error-message" value="IpBlockInstall failure and deletePool deleted in EIPAM" />
-</return></block></outcome><outcome value="Other">
-
-<block><save
- plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
- resource='SQL'
- key="UPDATE EIPAM_IP_SUBNETS
- SET status = 'ERROR'
- WHERE entity_id = $eipam-ip-block.entity-id ; "
- force='true'
- pfx='pfx.eipam-subnet-row'>
-</save><set>
- <parameter name="eipam-ip-block.status" value="ERROR" /></set><save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block">
- <parameter name="eipam-ip-block.status" value="ERROR" /></save><execute plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' method='setStatusMethod' >
-<parameter name="key1" value="IpBlockInstall failure and pool deletion failed in EIPAM, need to manually delete."/></execute><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="vpe" key="vnf-id = $data-change-notification-input.key-data[0].key-value" pfx="vpe-after">
- <parameter name="operational-state" value="NCS_IP_SUBNET_INSTALL_ERROR" />
- <parameter name="summary-status" value="`$aai-summary-status-message`" />
- <parameter name="prov-status" value="PREPROV" />
-</update> <return status="failure">
- <parameter name="error-code" value="1000" />
- <parameter name="error-message" value="IpBlockInstall failure and deletePool failed in EIPAM, need to manually delete" />
-</return></block></outcome></execute></outcome></configure></outcome><!--If no ptnii-name, check if VIPR or SRIOV--><outcome value=''><execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="startsWith" emitsOutcome='true' >
-<parameter name="source" value="`toUpperCase($eipam-ip-block.plan-name)`" />
-<parameter name="target" value="AIC_" />
-
-<outcome value='false'>
- <return status="failure">
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Unknown Address Plan - not supported!" />
-</return></outcome><outcome value='true'>
-<block atomic='true'><get-resource
- plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
- resource='SQL'
- key="SELECT * FROM EIPAM_IP_POOLS where plan_name = $eipam-ip-block.plan-name and level = 2 and key_value = $tmp.level2-key-value ;"
- pfx='tmp.eipam-pool-row'>
-
-<outcome value='failure'>
-<block atomic='true'><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="subnet-allocated-notification"/>
-<parameter name="field3" value="`$eipam-ip-block.request-id`"/>
-<parameter name="field4" value="`$eipam-ip-block.entity-id`"/>
-<parameter name="field5" value="`$eipam-ip-block.ptnii-name`"/>
-<parameter name="field6" value="`$eipam-ip-block.ip-address`"/>
-<parameter name="field7" value="`$eipam-ip-block.prefix-length`"/>
-<parameter name="field8" value="`$eipam-ip-block.status`"/>
-<parameter name="field9" value="Failed to find this record in DB!"/>
-
-</record> <return status="failure">
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Unknown EIPAM pool - not found in DB!" />
-</return></block></outcome><outcome value="not-found"><block atomic='true'><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="subnet-allocated-notification"/>
-<parameter name="field3" value="`$eipam-ip-block.request-id`"/>
-<parameter name="field4" value="`$eipam-ip-block.entity-id`"/>
-<parameter name="field5" value="`$eipam-ip-block.ptnii-name`"/>
-<parameter name="field6" value="`$eipam-ip-block.ip-address`"/>
-<parameter name="field7" value="`$eipam-ip-block.prefix-length`"/>
-<parameter name="field8" value="`$eipam-ip-block.status`"/>
-<parameter name="field9" value="This record is not found in DB!"/></record> <return status="failure">
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Unknown EIPAM pool - not found in DB!" />
-</return></block></outcome></get-resource><!--initial subnet should exists--><get-resource
- plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
- resource='SQL'
- key="SELECT * from EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k WHERE s.plan_name = $eipam-ip-block.plan-name and s.entity_id = k.entity_id and k.level = 2 and k.key_value = $tmp.level2-key-value and s.address_family = $tmp.version ; "
- pfx='pfx.eipam-initial-subnet'>
-
-<outcome value='failure'>
-<return status="failure">
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
- </return></outcome><outcome value="not-found"><return status="failure">
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Initial subnet not found, cannot auto extend." />
- </return></outcome></get-resource><!--check if new subnet already exists, possibly from previous attempt.--><get-resource
- plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
- resource='SQL'
- key="SELECT * from EIPAM_IP_SUBNETS s WHERE s.plan_name = $eipam-ip-block.plan-name and s.entity_id = $eipam-ip-block.entity-id and s.ip_address = $eipam-ip-block.ip-address ; "
- pfx='pfx.eipam-subnet-with-same-ip'>
-
-<outcome value='failure'>
-<return status="failure">
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
- </return></outcome><outcome value="not-found"></outcome></get-resource><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="l3-network"
- key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id"
- local-only="false"
- pfx="aai.l3-network">
-<outcome value='not-found'>
-<return status='failure'>
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
- <parameter name="error-code" value="404" />
- <parameter name="error-message" value="'l3-network with network-id=' + $pfx.eipam-initial-subnet.network-id + 'Not found in AnAI'" /></return></outcome><outcome value='failure'>
-<return status='failure'>
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="'Error retrieving l3-network with network-id=' + $pfx.eipam-initial-subnet.network-id + 'from AnAI'" /></return></outcome></get-resource><set>
-<parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
-</set><save
- plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
- resource='SQL'
- key="INSERT EIPAM_IP_SUBNETS
- SET
- entity_id = $eipam-ip-block.entity-id ,
- service_type = $pfx.eipam-initial-subnet.service-type ,
- ip_address = $eipam-ip-block.ip-prefix ,
- prefix_length = $eipam-ip-block.mask ,
- plan_name = $eipam-ip-block.plan-name ,
- status = 'PENDING_ACTIVE' ,
- pool_id = $pfx.eipam-initial-subnet.pool-id ,
- address_family = $pfx.eipam-initial-subnet.address-family ,
- network_id = $pfx.eipam-initial-subnet.network-id ; "
- force='true'
- pfx='pfx.eipam-new-subnet'>
-<outcome value='failure'><return status="failure">
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Insert to DB table EIPAM_IP_SUBNETS failed." />
- </return></outcome><outcome value='success'>
-</outcome></save><save
- plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
- resource='SQL'
- key="INSERT EIPAM_IP_SUBNET_KEYS
- SET
- entity_id = $eipam-ip-block.entity-id ,
- key_name = $tmp.level1-key-name ,
- key_value = $tmp.level1-key-value ,
- level = 1 ; "
- force='true'
- pfx='pfx.eipam-subnet-level1'>
-<outcome value='success'>
-</outcome><outcome value='failure'><return status="failure">
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Insert to DB table EIPAM_IP_SUBNET_KEYS failed." />
- </return></outcome></save><save
- plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
- resource='SQL'
- key="INSERT EIPAM_IP_SUBNET_KEYS
- SET
- entity_id = $eipam-ip-block.entity-id ,
- key_name = $tmp.level2-key-name ,
- key_value = $tmp.level2-key-value ,
- level = 2 ; "
- force='true'
- pfx='pfx.eipam-subnet-level2'>
-<outcome value='success'>
-</outcome><outcome value='failure'><return status="failure">
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Insert to DB table EIPAM_IP_SUBNET_KEYS failed." />
- </return></outcome></save><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="Added an entry for subnet-allocated-notification in EIPAM_IP_SUBNETS and EIPAM_IP_SUBNET_KEYS"/>
-<parameter name="field3" value="`$eipam-ip-block.request-id`"/>
-<parameter name="field4" value="`$eipam-ip-block.entity-id`"/>
-<parameter name="field5" value="`$pfx.eipam-initial-subnet.network-id`"/>
-<parameter name="field6" value="`$eipam-ip-block.ip-address`"/>
-<parameter name="field7" value="`$eipam-ip-block.prefix-length`"/>
-<parameter name="field8" value="`$eipam-ip-block.status`"/>
-<parameter name="field9" value="`$tmp.key-value`"/></record><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="subnet"
- key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id
- AND subnet.subnet-id = $eipam-ip-block.entity-id"
- local-only="false"
- pfx="tmp.aai-initial-subnet">
-<outcome value='not-found'>
-<return status='failure'>
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
- <parameter name="error-code" value="404" />
- <parameter name="error-message" value="'l3-network with network-id=' + $pfx.eipam-initial-subnet.network-id + ' And subnet-id=' + $eipam-ip-block.entity-id + ' is Not found in AnAI'" /></return></outcome><outcome value='failure'>
-<return status='failure'>
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="'Error retrieving l3-network with network-id=' + $pfx.eipam-initial-subnet.network-id + ' And subnet-id=' + $eipam-ip-block.entity-id + ' from AnAI'" /></return></outcome></get-resource><switch test='`$aai.l3-network.subnets.subnet_length`'>
-<outcome value=''>
-<return status='failure'>
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
- <parameter name="error-code" value="404" />
- <parameter name="error-message" value="'No subnets found in AAI for network-id=' + $pfx.eipam-initial-subnet.network-id" /></return></outcome><outcome value='Other'>
-<set>
-<parameter name='tmp.l3-network.subnet.subnet-name' value="`$aai.l3-network.network-name + '_S' + $aai.l3-network.subnets.subnet_length`" />
-</set></outcome></switch><execute plugin="com.att.sdnctl.sli.plugin.ipAddressTools.IpAddressTool" method="getSubnetAddresses">
- <parameter name="ipAddress" value="`$eipam-ip-block.ip-prefix`" />
- <parameter name="ipVersion" value="`tmp.version`" />
- <parameter name="subnet" value="`$eipam-ip-block.prefix-length`" />
- <parameter name="ctxGateway" value="tmp.return.generate.gateway-address" />
- <parameter name="ctxDhcpStart" value="tmp.return.generate.dhcp-start-address" />
- <parameter name="ctxDhcpEnd" value="tmp.return.generate.dhcp-end-address" />
-
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Failed to generate gateway addresses using IpAddressTools" /></return></outcome></execute><switch test='`$tmp.aai-initial-subnet.dhcp-enabled`'>
-<outcome value='Y'>
-<block atomic="true"><set>
-<parameter name='tmp.l3-network.subnet.dhcp-enabled' value='true' />
-<parameter name='tmp.l3-network.subnet.dhcp-start' value='`$tmp.return.generate.dhcp-start-address`' />
-<parameter name='tmp.l3-network.subnet.dhcp-end' value='`$tmp.return.generate.dhcp-end-address`' />
-
-
-</set></block></outcome><outcome value='N'>
-<block atomic="true"><set>
-<parameter name='tmp.l3-network.subnet.dhcp-enabled' value='false' />
-<parameter name='tmp.l3-network.subnet.dhcp-start' value='' />
-<parameter name='tmp.l3-network.subnet.dhcp-end' value='' />
-
-
-</set></block></outcome></switch><save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="subnet"
- key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id
- AND subnet.subnet-id = $eipam-ip-block.entity-id" >
-<!-- Create l3-network object -->
-<parameter name="network-id" value="`$pfx.eipam-initial-subnet.network-id`" />
-<parameter name="subnet-id" value="`$eipam-ip-block.entity-id`" />
-<parameter name="subnet-name" value="`$tmp.l3-network.subnet.subnet-name`" />
-<parameter name="gateway-address" value="`$tmp.return.generate.gateway-address`" />
-<parameter name="network-start-address" value="`$eipam-ip-block.ip-prefix`" />
-<parameter name="cidr-mask" value="`$eipam-ip-block.prefix-length`" />
-<parameter name="ip-version" value="`$tmp.version`" />
-<parameter name="dhcp-start" value="`$tmp.l3-network.subnet.dhcp-start`" />
-<parameter name="dhcp-end" value="`$tmp.l3-network.subnet.dhcp-end`" />
-<parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet.dhcp-enabled`" />
-<parameter name="orchestration-status" value="PendingCreate" /><outcome value='failure'>
-<return status='failure'>
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="'Cannot save subnet with l3 network-id=' + $pfx.eipam-initial-subnet.network-id + ' And subnet-id=' + $eipam-ip-block.entity-id + ' in AnAI'" /></return></outcome><outcome value='not-found'>
-</outcome></save><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="Added a subnetin AAI"/>
-<parameter name="field3" value="`$eipam-ip-block.request-id`"/>
-<parameter name="field4" value="`$eipam-ip-block.entity-id`"/>
-<parameter name="field5" value="`$pfx.eipam-initial-subnet.network-id`"/>
-<parameter name="field6" value="`$eipam-ip-block.ip-address`"/>
-<parameter name="field7" value="`$eipam-ip-block.prefix-length`"/>
-<parameter name="field8" value="`$eipam-ip-block.status`"/>
-<parameter name="field9" value="`$tmp.key-value`"/></record><execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
-<parameter name='api-name' value='subnet' />
-<parameter name='api-action' value='add' />
-<parameter name='resp-prefix' value='contrailResp' />
-<parameter name='contrail-virtual-network-id' value='`$pfx.eipam-initial-subnet.network-id`' />
-<parameter name='ip-prefix' value='`$eipam-ip-block.ip-prefix`' />
-<parameter name='ip-prefix-len' value='`$eipam-ip-block.prefix-length`' />
-<parameter name='dns-server-address' value='0.0.0.0' />
-<parameter name='enable-dhcp' value='`$tmp.l3-network.subnet.dhcp-enabled`' />
-<parameter name='default-gateway' value='`$tmp.return.generate.gateway-address`' />
-<parameter name='subnet-name' value='`$tmp.l3-network.subnet.subnet-name`' />
-<parameter name='start' value='`$tmp.l3-network.subnet.dhcp-start`' />
-<parameter name='end' value='`$tmp.l3-network.subnet.dhcp-end`' />
-<outcome value='success'>
-<block>
-</block></outcome><outcome value='failure'>
-<block>
-<set>
- <parameter name="eipam-ip-block.status" value="ERROR" /></set><save
- plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
- resource='SQL'
- key="UPDATE EIPAM_IP_SUBNETS
- SET status = 'ERROR'
- WHERE entity_id = $eipam-ip-block.entity-id ; "
- force='true'
- pfx='pfx.eipam-subnet-row'>
-<outcome value='failure'>
-<return status="failure">
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while updating subnet to ERROR in mysql." />
- </return></outcome><outcome value="not-found"><return status="failure">
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while updating subnet to ERROR in mysql." />
- </return></outcome></save><delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="subnet"
- key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id
- AND subnet.subnet-id = $eipam-ip-block.entity-id"></delete><save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block">
- <parameter name="eipam-ip-block.status" value="ERROR" /></save><return status='failure'>
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'Failed to create subnet in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" />
-</return></block></outcome></execute><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="Added a subnet in Contrail"/>
-<parameter name="field3" value="`$eipam-ip-block.request-id`"/>
-<parameter name="field4" value="`$eipam-ip-block.entity-id`"/>
-<parameter name="field5" value="`$pfx.eipam-initial-subnet.network-id`"/>
-<parameter name="field6" value="`$eipam-ip-block.ip-address`"/>
-<parameter name="field7" value="`$eipam-ip-block.prefix-length`"/>
-<parameter name="field8" value="`$eipam-ip-block.status`"/>
-<parameter name="field9" value="`$tmp.key-value`"/></record><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="subnet"
- key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id
- AND subnet.subnet-id = $eipam-ip-block.entity-id" >
- <parameter name="orchestration-status" value="Created" />
- <outcome value='not-found'>
-</outcome><outcome value='failure'>
-<block>
-<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="Update status to Created failed in AAI"/>
-<parameter name="field3" value="`$eipam-ip-block.request-id`"/>
-<parameter name="field4" value="`$eipam-ip-block.entity-id`"/>
-<parameter name="field5" value="`$pfx.eipam-initial-subnet.network-id`"/>
-<parameter name="field6" value="`$eipam-ip-block.ip-address`"/>
-<parameter name="field7" value="`$eipam-ip-block.prefix-length`"/>
-<parameter name="field8" value="`$eipam-ip-block.status`"/>
-<parameter name="field9" value="`$tmp.key-value`"/></record><save
- plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
- resource='SQL'
- key="UPDATE EIPAM_IP_SUBNETS
- SET status = 'ERROR'
- WHERE entity_id = $eipam-ip-block.entity-id ; "
- force='true'
- pfx='pfx.eipam-subnet-row'>
-<outcome value='failure'>
-<return status="failure">
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while updating subnet to ERROR in mysql." />
- </return></outcome><outcome value="not-found"><return status="failure">
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while updating subnet to ERROR in mysql." />
- </return></outcome></save><delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="subnet"
- key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id
- AND subnet.subnet-id = $eipam-ip-block.entity-id"></delete><execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
-<parameter name='api-name' value='subnet' />
-<parameter name='api-action' value='delete' />
-<parameter name='resp-prefix' value='contrailResp' />
-<parameter name='contrail-virtual-network-id' value='`$pfx.eipam-initial-subnet.network-id`' />
-<parameter name='ip-prefix' value='`$eipam-ip-block.ip-prefix`' />
-<outcome value='failure'>
-<return status='failure'>
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'Failed to delete subnet in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" />
-</return></outcome></execute><set>
- <parameter name="eipam-ip-block.status" value="ERROR" /></set><return status='failure'>
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="'Cannot save subnet status to Created with l3 network-id=' + $pfx.eipam-initial-subnet.network-id + ' And subnet-id=' + $eipam-ip-block.entity-id + ' in AnAI'" /></return></block></outcome></update><save
- plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
- resource='SQL'
- key="UPDATE EIPAM_IP_SUBNETS
- SET status = 'CREATED'
- WHERE entity_id = $eipam-ip-block.entity-id ; "
- force='true'
- pfx='pfx.eipam-subnet-row'>
-<outcome value='failure'>
-<return status="failure">
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while updating subnet to CREATED in mysql." />
- </return></outcome><outcome value="not-found"><return status="failure">
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while updating subnet to CREATED in mysql." />
- </return></outcome></save><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="activateSubnet">
-<outcome value='failure'><return status="failure">
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while activating subnet in EIPAM." />
- </return></outcome></execute><save
- plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
- resource='SQL'
- key="UPDATE EIPAM_IP_SUBNETS
- SET status = 'ACTIVE'
- WHERE entity_id = $eipam-ip-block.entity-id ; "
- force='true'
- pfx='pfx.eipam-subnet-row'>
-<outcome value='failure'>
-<return status="failure">
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while updating subnet to active in mysql." />
- </return></outcome><outcome value="not-found"><return status="failure">
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="An error occured while updating subnet to active in mysql." />
- </return></outcome><outcome value='success'>
-</outcome></save><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="subnet"
- key="l3-network.network-id = $aai.l3-network.network-id
- AND subnet.subnet-id = $eipam-ip-block.entity-id" >
-<parameter name="orchestration-status" value="Created" />
- <outcome value='failure'>
-<return status="failure">
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet." />
- </return></outcome><outcome value="not-found"><return status="failure">
- <parameter name="error-code" value="500"/>
- <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet. Subnet not found." />
- </return></outcome></update> <return status="success">
- <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
-</return></block></outcome></execute></outcome></switch></block></method></service-logic>
+<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='SUBNET-API' version='${project.version}'>
+ <method rpc='subnet-allocated-notification' mode='sync'>
+ <block>
+ <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="subnet-allocated-notification"/>
+ <parameter name="field3" value="`$eipam-ip-block.request-id`"/>
+ <parameter name="field4" value="`$eipam-ip-block.entity-id`"/>
+ <parameter name="field5" value="`$eipam-ip-block.ptnii-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.ip-address`"/>
+ <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/>
+ <parameter name="field8" value="`$eipam-ip-block.status`"/>
+ <parameter name="field9" value="`$tmp.key-value`"/>
+ </record>
+ <!--Need to know which ipv version to get the plan name from the network-model.-->
+ <switch test="`$eipam-ip-block.ptnii-name`">
+ <!--If there's ptnii-name, then it's Gamma service-->
+ <outcome value='Other'>
+ <block>
+ <configure adaptor="com.att.sdnctl.sli.adaptor.ncs.ncsAdaptor" key="SNIIR" activate="true">
+ <parameter name="input.request-id" value="`$eipam-ip-block.request-id`" />
+ <parameter name="input.source" value="SDNC" />
+ <parameter name="input.ptnii-name" value="`$eipam-ip-block.ptnii-name`" />
+ <parameter name="input.ip-address" value="`$eipam-ip-block.ip-address`" />
+ <parameter name="input.mask" value="`$eipam-ip-block.prefix-length`" />
+ <outcome value="success">
+ <block>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="UPDATE EIPAM_IP_SUBNETS
+ SET status = 'PENDING-ACTIVE'
+ WHERE entity_id = $eipam-ip-block.entity-id ; "
+ force='true'
+ pfx='pfx.eipam-subnet-row'></save>
+ <set>
+ <parameter name="eipam-ip-block.status" value="PENDING-ACTIVE" />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block">
+ <parameter name="eipam-ip-block.status" value="PENDING-ACTIVE" />
+ </save>
+ <return status="success"></return>
+ </block>
+ </outcome>
+ <outcome value="Other">
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePool">
+ <outcome value="success">
+ <block>
+ <set>
+ <parameter name="eipam-ip-block.status" value="DELETED" />
+ </set>
+ <return status="failure">
+ <parameter name="error-code" value="1000" />
+ <parameter name="error-message" value="IpBlockInstall failure and deletePool deleted in EIPAM" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value="Other">
+ <block>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="UPDATE EIPAM_IP_SUBNETS
+ SET
+ status = 'ERROR',
+ dealloc_failure = 'deletePool failed in response to NCS_IP_SUBNET_INSTALL_ERROR'
+ WHERE entity_id = $eipam-ip-block.entity-id ; "
+ force='true'
+ pfx='pfx.eipam-subnet-row'></save>
+ <set>
+ <parameter name="eipam-ip-block.status" value="NCS_IP_SUBNET_INSTALL_ERROR" />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="generic-vnf" key="generic-vnf.vnf-id = $tmp.vpe-pool.vpe-id" pfx="vpe-after">
+ <parameter name="operational-status" value="NCS_IP_SUBNET_INSTALL_ERROR" />
+ <parameter name="summary-status" value="`$aai-summary-status-message`" />
+ <parameter name="prov-status" value="PREPROV" />
+ </update>
+ <return status="failure">
+ <parameter name="error-code" value="1000" />
+ <parameter name="error-message" value="IpBlockInstall failure and deletePool failed in EIPAM, need to manually delete" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ </outcome>
+ </configure>
+ </block>
+ </outcome>
+ <!--If no ptnii-name, check if VIPR or SRIOV-->
+ <outcome value=''>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="startsWith" emitsOutcome='true' >
+ <parameter name="source" value="`toUpperCase($eipam-ip-block.plan-name)`" />
+ <parameter name="target" value="AIC_" />
+ <outcome value='false'>
+ <return status="failure">
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Unknown Address Plan - not supported!" />
+ </return>
+ </outcome>
+ <outcome value='true'>
+ <block atomic='true'>
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * FROM EIPAM_IP_POOLS where plan_name = $eipam-ip-block.plan-name and level = 2 and key_value = $tmp.level2-key-value ;"
+ pfx='tmp.eipam-pool-row'>
+ <outcome value='failure'>
+ <block atomic='true'>
+ <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="subnet-allocated-notification"/>
+ <parameter name="field3" value="`$eipam-ip-block.request-id`"/>
+ <parameter name="field4" value="`$eipam-ip-block.entity-id`"/>
+ <parameter name="field5" value="`$eipam-ip-block.ptnii-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.ip-address`"/>
+ <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/>
+ <parameter name="field8" value="`$eipam-ip-block.status`"/>
+ <parameter name="field9" value="Failed to find this record in DB!"/>
+ </record>
+ <return status="failure">
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Unknown EIPAM pool - not found in DB!" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value="not-found">
+ <block atomic='true'>
+ <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="subnet-allocated-notification"/>
+ <parameter name="field3" value="`$eipam-ip-block.request-id`"/>
+ <parameter name="field4" value="`$eipam-ip-block.entity-id`"/>
+ <parameter name="field5" value="`$eipam-ip-block.ptnii-name`"/>
+ <parameter name="field6" value="`$eipam-ip-block.ip-address`"/>
+ <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/>
+ <parameter name="field8" value="`$eipam-ip-block.status`"/>
+ <parameter name="field9" value="This record is not found in DB!"/>
+ </record>
+ <return status="failure">
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Unknown EIPAM pool - not found in DB!" />
+ </return>
+ </block>
+ </outcome>
+ </get-resource>
+ <!--initial subnet should exists-->
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_SUBNETS s, EIPAM_IP_SUBNET_KEYS k WHERE s.plan_name = $eipam-ip-block.plan-name and s.entity_id = k.entity_id and k.level = 2 and k.key_value = $tmp.level2-key-value and s.address_family = $tmp.version ; "
+ pfx='pfx.eipam-initial-subnet'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Initial subnet not found, cannot auto extend." />
+ </return>
+ </outcome>
+ </get-resource>
+ <!--check if new subnet already exists, possibly from previous attempt.-->
+ <get-resource
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="SELECT * from EIPAM_IP_SUBNETS s WHERE s.plan_name = $eipam-ip-block.plan-name and s.entity_id = $eipam-ip-block.entity-id and s.ip_address = $eipam-ip-block.ip-address ; "
+ pfx='pfx.eipam-subnet-with-same-ip'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNET_KEYS and EIPAM_IP_SUBNETS failed." />
+ </return>
+ </outcome>
+ <outcome value="not-found"></outcome>
+ </get-resource>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="l3-network"
+ key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id"
+ local-only="false"
+ pfx="aai.l3-network">
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="'l3-network with network-id=' + $pfx.eipam-initial-subnet.network-id + 'Not found in AnAI'" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="'Error retrieving l3-network with network-id=' + $pfx.eipam-initial-subnet.network-id + 'from AnAI'" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ </set>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNETS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ service_type = $pfx.eipam-initial-subnet.service-type ,
+ ip_address = $eipam-ip-block.ip-prefix ,
+ prefix_length = $eipam-ip-block.mask ,
+ plan_name = $eipam-ip-block.plan-name ,
+ status = 'PENDING_ACTIVE' ,
+ pool_id = $pfx.eipam-initial-subnet.pool-id ,
+ address_family = $pfx.eipam-initial-subnet.address-family ,
+ network_id = $pfx.eipam-initial-subnet.network-id ; "
+ force='true'
+ pfx='pfx.eipam-new-subnet'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Insert to DB table EIPAM_IP_SUBNETS failed." />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $tmp.level1-key-name ,
+ key_value = $tmp.level1-key-value ,
+ level = 1 ; "
+ force='true'
+ pfx='pfx.eipam-subnet-level1'>
+ <outcome value='success'></outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Insert to DB table EIPAM_IP_SUBNET_KEYS failed." />
+ </return>
+ </outcome>
+ </save>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="INSERT EIPAM_IP_SUBNET_KEYS
+ SET
+ entity_id = $eipam-ip-block.entity-id ,
+ key_name = $tmp.level2-key-name ,
+ key_value = $tmp.level2-key-value ,
+ level = 2 ; "
+ force='true'
+ pfx='pfx.eipam-subnet-level2'>
+ <outcome value='success'></outcome>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Insert to DB table EIPAM_IP_SUBNET_KEYS failed." />
+ </return>
+ </outcome>
+ </save>
+ <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="Added an entry for subnet-allocated-notification in EIPAM_IP_SUBNETS and EIPAM_IP_SUBNET_KEYS"/>
+ <parameter name="field3" value="`$eipam-ip-block.request-id`"/>
+ <parameter name="field4" value="`$eipam-ip-block.entity-id`"/>
+ <parameter name="field5" value="`$pfx.eipam-initial-subnet.network-id`"/>
+ <parameter name="field6" value="`$eipam-ip-block.ip-address`"/>
+ <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/>
+ <parameter name="field8" value="`$eipam-ip-block.status`"/>
+ <parameter name="field9" value="`$tmp.key-value`"/>
+ </record>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id
+ AND subnet.subnet-id = $eipam-ip-block.entity-id"
+ local-only="false"
+ pfx="tmp.aai-initial-subnet">
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="'l3-network with network-id=' + $pfx.eipam-initial-subnet.network-id + ' And subnet-id=' + $eipam-ip-block.entity-id + ' is Not found in AnAI'" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="'Error retrieving l3-network with network-id=' + $pfx.eipam-initial-subnet.network-id + ' And subnet-id=' + $eipam-ip-block.entity-id + ' from AnAI'" />
+ </return>
+ </outcome>
+ </get-resource>
+ <switch test='`$aai.l3-network.subnets.subnet_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="'No subnets found in AAI for network-id=' + $pfx.eipam-initial-subnet.network-id" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.l3-network.subnet.subnet-name' value="`$aai.l3-network.network-name + '_S' + $aai.l3-network.subnets.subnet_length`" />
+ </set>
+ </outcome>
+ </switch>
+ <execute plugin="com.att.sdnctl.sli.plugin.ipAddressTools.IpAddressTool" method="getSubnetAddresses">
+ <parameter name="ipAddress" value="`$eipam-ip-block.ip-prefix`" />
+ <parameter name="ipVersion" value="`tmp.version`" />
+ <parameter name="subnet" value="`$eipam-ip-block.prefix-length`" />
+ <parameter name="ctxGateway" value="tmp.return.generate.gateway-address" />
+ <parameter name="ctxDhcpStart" value="tmp.return.generate.dhcp-start-address" />
+ <parameter name="ctxDhcpEnd" value="tmp.return.generate.dhcp-end-address" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failed to generate gateway addresses using IpAddressTools" />
+ </return>
+ </outcome>
+ </execute>
+ <switch test='`$tmp.aai-initial-subnet.dhcp-enabled`'>
+ <outcome value='Y'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.l3-network.subnet.dhcp-enabled' value='true' />
+ <parameter name='tmp.l3-network.subnet.dhcp-start' value='`$tmp.return.generate.dhcp-start-address`' />
+ <parameter name='tmp.l3-network.subnet.dhcp-end' value='`$tmp.return.generate.dhcp-end-address`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='N'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.l3-network.subnet.dhcp-enabled' value='false' />
+ <parameter name='tmp.l3-network.subnet.dhcp-start' value='' />
+ <parameter name='tmp.l3-network.subnet.dhcp-end' value='' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id
+ AND subnet.subnet-id = $eipam-ip-block.entity-id" >
+ <!-- Create l3-network object -->
+ <parameter name="network-id" value="`$pfx.eipam-initial-subnet.network-id`" />
+ <parameter name="subnet-id" value="`$eipam-ip-block.entity-id`" />
+ <parameter name="subnet-name" value="`$tmp.l3-network.subnet.subnet-name`" />
+ <parameter name="gateway-address" value="`$tmp.return.generate.gateway-address`" />
+ <parameter name="network-start-address" value="`$eipam-ip-block.ip-prefix`" />
+ <parameter name="cidr-mask" value="`$eipam-ip-block.prefix-length`" />
+ <parameter name="ip-version" value="`$tmp.version`" />
+ <parameter name="dhcp-start" value="`$tmp.l3-network.subnet.dhcp-start`" />
+ <parameter name="dhcp-end" value="`$tmp.l3-network.subnet.dhcp-end`" />
+ <parameter name="dhcp-enabled" value="`$tmp.l3-network.subnet.dhcp-enabled`" />
+ <parameter name="orchestration-status" value="PendingCreate" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="'Cannot save subnet with l3 network-id=' + $pfx.eipam-initial-subnet.network-id + ' And subnet-id=' + $eipam-ip-block.entity-id + ' in AnAI'" />
+ </return>
+ </outcome>
+ <outcome value='not-found'></outcome>
+ </save>
+ <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="Added a subnetin AAI"/>
+ <parameter name="field3" value="`$eipam-ip-block.request-id`"/>
+ <parameter name="field4" value="`$eipam-ip-block.entity-id`"/>
+ <parameter name="field5" value="`$pfx.eipam-initial-subnet.network-id`"/>
+ <parameter name="field6" value="`$eipam-ip-block.ip-address`"/>
+ <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/>
+ <parameter name="field8" value="`$eipam-ip-block.status`"/>
+ <parameter name="field9" value="`$tmp.key-value`"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='subnet' />
+ <parameter name='api-action' value='add' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='contrail-virtual-network-id' value='`$pfx.eipam-initial-subnet.network-id`' />
+ <parameter name='ip-prefix' value='`$eipam-ip-block.ip-prefix`' />
+ <parameter name='ip-prefix-len' value='`$eipam-ip-block.prefix-length`' />
+ <parameter name='dns-server-address' value='0.0.0.0' />
+ <parameter name='enable-dhcp' value='`$tmp.l3-network.subnet.dhcp-enabled`' />
+ <parameter name='default-gateway' value='`$tmp.return.generate.gateway-address`' />
+ <parameter name='subnet-name' value='`$tmp.l3-network.subnet.subnet-name`' />
+ <parameter name='start' value='`$tmp.l3-network.subnet.dhcp-start`' />
+ <parameter name='end' value='`$tmp.l3-network.subnet.dhcp-end`' />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='failure'>
+ <block>
+ <set>
+ <parameter name="eipam-ip-block.status" value="ERROR" />
+ </set>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="UPDATE EIPAM_IP_SUBNETS
+ SET status = 'ERROR'
+ WHERE entity_id = $eipam-ip-block.entity-id ; "
+ force='true'
+ pfx='pfx.eipam-subnet-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while updating subnet to ERROR in mysql." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while updating subnet to ERROR in mysql." />
+ </return>
+ </outcome>
+ </save>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id
+ AND subnet.subnet-id = $eipam-ip-block.entity-id"></delete>
+ <save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block">
+ <parameter name="eipam-ip-block.status" value="ERROR" />
+ </save>
+ <return status='failure'>
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to create subnet in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <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="Added a subnet in Contrail"/>
+ <parameter name="field3" value="`$eipam-ip-block.request-id`"/>
+ <parameter name="field4" value="`$eipam-ip-block.entity-id`"/>
+ <parameter name="field5" value="`$pfx.eipam-initial-subnet.network-id`"/>
+ <parameter name="field6" value="`$eipam-ip-block.ip-address`"/>
+ <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/>
+ <parameter name="field8" value="`$eipam-ip-block.status`"/>
+ <parameter name="field9" value="`$tmp.key-value`"/>
+ </record>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id
+ AND subnet.subnet-id = $eipam-ip-block.entity-id" >
+ <parameter name="orchestration-status" value="Created" />
+ <outcome value='not-found'></outcome>
+ <outcome value='failure'>
+ <block>
+ <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="Update status to Created failed in AAI"/>
+ <parameter name="field3" value="`$eipam-ip-block.request-id`"/>
+ <parameter name="field4" value="`$eipam-ip-block.entity-id`"/>
+ <parameter name="field5" value="`$pfx.eipam-initial-subnet.network-id`"/>
+ <parameter name="field6" value="`$eipam-ip-block.ip-address`"/>
+ <parameter name="field7" value="`$eipam-ip-block.prefix-length`"/>
+ <parameter name="field8" value="`$eipam-ip-block.status`"/>
+ <parameter name="field9" value="`$tmp.key-value`"/>
+ </record>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="UPDATE EIPAM_IP_SUBNETS
+ SET status = 'ERROR'
+ WHERE entity_id = $eipam-ip-block.entity-id ; "
+ force='true'
+ pfx='pfx.eipam-subnet-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while updating subnet to ERROR in mysql." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while updating subnet to ERROR in mysql." />
+ </return>
+ </outcome>
+ </save>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $pfx.eipam-initial-subnet.network-id
+ AND subnet.subnet-id = $eipam-ip-block.entity-id"></delete>
+ <execute plugin='org.onap.ccsdk.sli.plugins.contrail.ContrailAdaptor' method='sendContrailRequest' emitsOutcome='true' >
+ <parameter name='api-name' value='subnet' />
+ <parameter name='api-action' value='delete' />
+ <parameter name='resp-prefix' value='contrailResp' />
+ <parameter name='contrail-virtual-network-id' value='`$pfx.eipam-initial-subnet.network-id`' />
+ <parameter name='ip-prefix' value='`$eipam-ip-block.ip-prefix`' />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Failed to delete subnet in Contrail. '+ $contrailResp.resp-code + ':' +$contrailResp.resp-message `" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name="eipam-ip-block.status" value="ERROR" />
+ </set>
+ <return status='failure'>
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="'Cannot save subnet status to Created with l3 network-id=' + $pfx.eipam-initial-subnet.network-id + ' And subnet-id=' + $eipam-ip-block.entity-id + ' in AnAI'" />
+ </return>
+ </block>
+ </outcome>
+ </update>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="UPDATE EIPAM_IP_SUBNETS
+ SET status = 'CREATED'
+ WHERE entity_id = $eipam-ip-block.entity-id ; "
+ force='true'
+ pfx='pfx.eipam-subnet-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while updating subnet to CREATED in mysql." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while updating subnet to CREATED in mysql." />
+ </return>
+ </outcome>
+ </save>
+ <!--subnet and subnet_keys are deleted in the EIPAMPlugin-->
+ <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="activateSubnet">
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while activating subnet in EIPAM." />
+ </return>
+ </outcome>
+ </execute>
+ <save
+ plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource='SQL'
+ key="UPDATE EIPAM_IP_SUBNETS
+ SET status = 'ACTIVE'
+ WHERE entity_id = $eipam-ip-block.entity-id ; "
+ force='true'
+ pfx='pfx.eipam-subnet-row'>
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while updating subnet to active in mysql." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="An error occured while updating subnet to active in mysql." />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="subnet"
+ key="l3-network.network-id = $aai.l3-network.network-id
+ AND subnet.subnet-id = $eipam-ip-block.entity-id" >
+ <parameter name="orchestration-status" value="Created" />
+ <outcome value='failure'>
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet." />
+ </return>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="500"/>
+ <parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet. Subnet not found." />
+ </return>
+ </outcome>
+ </update>
+ <return status="success">
+ <parameter name='eipam-ip-block.request-id' value="`$eipam-ip-block.entity-id + '-' + $aai.l3-network.contrail-network-fqdn`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file