diff options
Diffstat (limited to 'platform-logic/generic-resource-api/src/main/xml')
-rwxr-xr-x | platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation-assign.xml | 931 |
1 files changed, 386 insertions, 545 deletions
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 8608ef20..27419ac3 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,545 +1,386 @@ -<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'
- 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'
- 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>
- <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'
- 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'
- 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'
- 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>
- <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 = $vnf-topology-operation-input.vnf-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>
- <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'
- 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"
- 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 ' + $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'
- 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'
- 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'
- 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'
- 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'
- 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'
- 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'
- 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'
- value='`$network-index`' />
- </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 > 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 ' + $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"
- 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'
- 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"
- 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'
- 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"
- 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>
\ No newline at end of file +<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'
+ 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'
+ 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><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'
+ 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'
+ 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'
+ 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><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 = $vnf-topology-operation-input.vnf-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><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'
+ 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"
+ 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 '
+ + $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'
+ 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'
+ 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'
+ 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'
+ 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'
+ 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'
+ 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'
+ 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'
+ value='`$network-index`' />
+</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 > 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 '
+ + $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"
+ 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'
+ 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"
+ 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'
+ 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"
+ 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>
|