diff options
32 files changed, 4041 insertions, 31 deletions
diff --git a/csit/plans/sdnc/setup.sh b/csit/plans/sdnc/setup.sh index 037bc2e2..ba1c0b86 100644 --- a/csit/plans/sdnc/setup.sh +++ b/csit/plans/sdnc/setup.sh @@ -74,10 +74,13 @@ export LOCAL_IP=$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+') unset http_proxy https_proxy +# Append test data to standard data init file to create db init script +cat ${WORKSPACE}/../installation/sdnc/src/main/resources/sdnctl.dump ${WORKSPACE}/scripts/csit-data.sql > ${WORKSPACE}/archives/csit-dbinit.sql # start SDNC containers with docker compose and configuration from docker-compose.yml docker-compose -f ${SCRIPTS}/docker-compose.yml up -d + # WAIT 5 minutes maximum and check karaf.log for readiness every 10 seconds TIME_OUT=300 @@ -145,6 +148,20 @@ cp ${REQUEST_DATA_PATH}/mount.xml.tmpl ${REQUEST_DATA_PATH}/mount.xml sed -i "s/pnfaddr/${LOCAL_IP}/g" "${REQUEST_DATA_PATH}"/mount.xml +# Load test dgs +docker exec ${SDNC_CONTAINER_NAME} mkdir -p /tmp/gra.patch + +for file in ${WORKSPACE}/plans/sdnc/testdata/*xml +do + docker cp $file ${SDNC_CONTAINER_NAME}:/tmp/gra.patch + mname=$(basename $file | cut -d. -f1| cut -d_ -f1) + bname=$(basename $file | cut -d. -f1| cut -d_ -f2-) + echo ${mname} ${bname} aai-disabled sync >> ${WORKSPACE}/archives/graph.versions +done +docker cp ${WORKSPACE}/archives/graph.versions ${SDNC_CONTAINER_NAME}:/tmp/gra.patch +docker exec ${SDNC_CONTAINER_NAME} /opt/onap/sdnc/svclogic/bin/svclogic.sh install /tmp/gra.patch /opt/onap/sdnc/svclogic/config/svclogic.properties + + ######################################################################### # Export SDNC, AAF-Certservice-Cient, Netconf-Pnp-Simulator Continer Names diff --git a/csit/plans/sdnc/teardown.sh b/csit/plans/sdnc/teardown.sh index 0c6c9944..e6b7faba 100644 --- a/csit/plans/sdnc/teardown.sh +++ b/csit/plans/sdnc/teardown.sh @@ -17,6 +17,5 @@ # Modifications copyright (c) 2017 AT&T Intellectual Property # Modifications copyright (c) 2020 Samsung Electronics Co., Ltd. # - docker-compose -f "${SCRIPTS}"/docker-compose.yml down -v docker-compose -f "${WORKSPACE}"/archives/pnf-simulator/netconfsimulator/docker-compose.yml down -v diff --git a/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_generate-host-routes-host-route-id.xml b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_generate-host-routes-host-route-id.xml new file mode 100644 index 00000000..0a03984c --- /dev/null +++ b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_generate-host-routes-host-route-id.xml @@ -0,0 +1,26 @@ +<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='aai-disabled'>
+ <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>
+ <set>
+ <parameter name="tmp.local-variables.generate-host-routes-host-route-id." value="" />
+ </set>
+ </block>
+ </method>
+</service-logic> diff --git a/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_network-topology-operation-assign-from-preload.xml b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_network-topology-operation-assign-from-preload.xml new file mode 100644 index 00000000..f9b5960c --- /dev/null +++ b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_network-topology-operation-assign-from-preload.xml @@ -0,0 +1,285 @@ +<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='aai-disabled'>
+ <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>
+ <set>
+ <parameter name="tmp.error-message" value=""/>
+ </set>
+ <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>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/lmr-nto.log' />
+ </execute>
+ <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'>
+ <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'>
+ <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>
+ <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'>
+ <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>
+ </block>
+ </for>
+ </block>
+ </for>
+ <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'></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>
+ <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>
+ <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' ></return>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_network-topology-operation-assign.xml b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_network-topology-operation-assign.xml new file mode 100644 index 00000000..d4cdd898 --- /dev/null +++ b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_network-topology-operation-assign.xml @@ -0,0 +1,86 @@ +<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='aai-disabled'>
+ <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>
+ <switch test="`$network-topology-operation-input.network-request-input.cloud-owner != ''`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.cloud-region.cloud-owner' value='`$network-topology-operation-input.network-request-input.cloud-owner`' />
+ </set>
+ </outcome>
+ </switch>
+ <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/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_network-topology-operation-unassign.xml b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_network-topology-operation-unassign.xml new file mode 100644 index 00000000..1b8a7d20 --- /dev/null +++ b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_network-topology-operation-unassign.xml @@ -0,0 +1,403 @@ +<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='aai-disabled'>
+ <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'></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
+ 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
+ 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
+ WHERE p.level = 2
+ and p.plan_name = $tmp.plan-name
+ and k.level = 1
+ 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
+ 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
+ WHERE p.level = 1
+ and p.plan_name = $tmp.plan-name
+ and k.level = 1
+ 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
+ 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
+ WHERE p.level = 2
+ and p.plan_name = $tmp.plan-name
+ and k.level = 1
+ 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
+ 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
+ WHERE p.level = 1
+ and p.plan_name = $tmp.plan-name
+ and k.level = 1
+ 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>
+ <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/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_service-topology-operation-assign.xml b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_service-topology-operation-assign.xml new file mode 100644 index 00000000..300c1a92 --- /dev/null +++ b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_service-topology-operation-assign.xml @@ -0,0 +1,185 @@ +<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='aai-disabled'>
+ <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>
+ <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`' />
+ <parameter name='generate-unique-name-input.service-instance-id' value='`$service-topology-operation-input.service-information.service-instance-id`' />
+ </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>
+ <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'
+ value='`$service-topology-operation-input.service-information.subscription-service-type`' />
+ <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'
+ value='`$service-topology-operation-input.service-information.global-customer-id`' />
+ </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'
+ 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'
+ 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>
\ No newline at end of file diff --git a/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vf-module-topology-operation-activate.xml b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vf-module-topology-operation-activate.xml new file mode 100644 index 00000000..e5f823a9 --- /dev/null +++ b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vf-module-topology-operation-activate.xml @@ -0,0 +1,175 @@ +<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='aai-disabled'>
+ <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>
+ <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.'
+ 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='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>
+ <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/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-sync.xml b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-sync.xml new file mode 100644 index 00000000..fa6271a4 --- /dev/null +++ b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vf-module-topology-operation-assign-sync.xml @@ -0,0 +1,705 @@ +<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='aai-disabled'>
+ <method rpc='vf-module-topology-operation-assign-sync' 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.vf-module-request-input.cloud-owner != ''`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.cloud-region.cloud-owner' value='`$vf-module-topology-operation-input.vf-module-request-input.cloud-owner`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.vf-module-request-input.cloud-owner`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.cloud-region.cloud-owner' value='`$vf-module-topology-operation-input.vf-module-request-input.cloud-owner`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$vf-module-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateVfModuleInstance'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="If svc-action is 'assign' then request-action must be 'CreateVfModuleInstance'" />
+ </return>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VF_MODULE_MODEL WHERE customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid'
+ pfx='db.vf-module-model'>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error reading VF_MODULE_MODEL table" />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No model found for VF module customization UUID ' + $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='vnf-index' value='-1' />
+ </set>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="There are no VNFs defined in MD-SAL" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vf-module-topology-operation-input.vnf-information.vnf-id`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ <switch test='`$vnf-index`'>
+ <outcome value='-1'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unable to find VNF ID ' + $vf-module-topology-operation-input.vnf-information.vnf-id + ' in MD-SAL'`" />
+ </return>
+ </outcome>
+ </switch>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vf-module-forking-logic' mode='sync' ></call>
+ <switch test="`$ss.self-serve-flag`">
+ <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 + ' with error: ' + $error-message`" />
+ </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'>
+ <block atomic="true">
+ <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>
+ <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=''>
+ <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='DUMMYCLLI' />
+ </set>
+ </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>
+ <switch test='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-name`'>
+ <outcome value=''>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-operation-assign-no-preload' mode='sync' >
+ <outcome value='failure'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='Other'>
+ <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'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </call>
+ </outcome>
+ <outcome value='Other'>
+ <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 retrieving preload-information" />
+ </return>
+ </block>
+ </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'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-topology-assign-rollback' mode='sync' ></call>
+ <return status='failure'></return>
+ </block>
+ </outcome>
+ </call>
+ </block>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vfmoduleb.log' />
+ </execute>
+ <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'>
+ <set>
+ <parameter name='automated-assignment' value='true' />
+ </set>
+ </outcome>
+ <outcome value='true'>
+ <set>
+ <parameter name='automated-assignment' value='false' />
+ </set>
+ </outcome>
+ </switch>
+ <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 atomic="true">
+ <set>
+ <parameter name='vnf-network-index' value='-1' />
+ </set>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network_length`' >
+ <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[$vnfc-network-index].vnfc-network-role
+ == $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$idx].network-role`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='vnf-network-index' value='`$idx`' />
+ </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[$vnfc-network-index].network-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$idx].network-id`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vnf-network-index`'>
+ <outcome value='-1'>
+ <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="`'VNFC network role '
+ + $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
+ + ' is not found in VNF network list'
+ `" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <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[$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[$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-index].vnfc-networks.vnfc-network-data[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip_length`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='0'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <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[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-address-family`' />
+ </set>
+ <block atomic="true">
+ <set>
+ <parameter name='af-count' value='0' />
+ </set>
+ <for index='subnet-data-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[$subnet-data-index].ip-version`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='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[$subnet-data-index].sdnc-subnet-id`' />
+ </set>
+ <set>
+ <parameter name='af-count' value='`$af-count + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$af-count`'>
+ <outcome value='1'>
+ <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[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].subnet-id'
+ value='`$subnet-id`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='subnet-id' value='-1' />
+ </set>
+ <for index='subnet-data-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[$subnet-data-index].ip-version`'>
+ <outcome value='true'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].network-start-address`'>
+ <outcome value=''>
+ <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="`'SDNC subnet id '
+ + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].sdnc-subnet-id
+ + ' does not have network-start-address populated'`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].cidr-mask`'>
+ <outcome value=''>
+ <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="`'SDNC subnet id '
+ + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].subnets-data.subnet-data[$subnet-data-index].sdnc-subnet-id
+ + ' does not have cidr-mask populated'`" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <switch test='`$tmp.address-family`'>
+ <outcome value='ipv4'>
+ <set>
+ <parameter name='ip-type' value='IPv4' />
+ </set>
+ </outcome>
+ <outcome value='ipv6'>
+ <set>
+ <parameter name='ip-type' value='IPv6' />
+ </set>
+ </outcome>
+ </switch>
+ <execute plugin="com.att.sdnctl.sli.plugin.ipAddressTools.IpAddressTool" method="isInSameSubnet">
+ <parameter name="firstIPAddr" 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[$subnet-data-index].network-start-address`" />
+ <parameter name="secondIPAddr" 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[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[0].vnfc-ip-address`" />
+ <parameter name="subnet" 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[$subnet-data-index].cidr-mask`" />
+ <parameter name="ipType" value="`$ip-type`" />
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='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[$subnet-data-index].sdnc-subnet-id`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$subnet-id`'>
+ <outcome value='-1'>
+ <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 able to find VNF network subnet that contains address '
+ + $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[$subnet-role-index].vnfc-ip-assignments[$address-family-index].vnfc-subnet-ip[0].vnfc-ip-address
+ `" />
+ </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[$vnfc-network-index].vnfc-subnet[$subnet-role-index].vnfc-ip-assignments[$address-family-index].subnet-id' value='`$subnet-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </for>
+ </block>
+ </for>
+ </for>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vfmodulec.log' />
+ </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='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">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VFC_RELATED_NETWORK_ROLE where vfc_customization_uuid = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].model-customization-uuid
+ and network_role = $tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].network-role'
+ pfx='db.vnf-related-network-role[]'>
+ <outcome value='failure'>
+ <block>
+ <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 reading VFC_RELATED_NETWORK_ROLE table" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <for index='db-related-network-index' start='0' end='`$db.vnf-related-network-role_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='found-related-network' value='false' />
+ </set>
+ <for silentFailure='true' 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`' >
+ <block atomic="true">
+ <for silentFailure='true' index='related-network-index' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].related-networks.related-network_length`' >
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$vnf-network-index].related-networks.related-network[$related-network-index].network-role
+ == $db.vnf-related-network-role[$db-related-network-index].related-network-role`'>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='found-related-network' value='true' />
+ </set>
+ <set>
+ <parameter name='saved-vnf-network-index' value='`$vnf-network-index`' />
+ <parameter name='saved-related-network-index' value='`$related-network-index`' />
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$found-related-network`'>
+ <outcome value='true'>
+ <break/>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$found-related-network`'>
+ <outcome value='false'>
+ <block>
+ <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="`'Unable to find related network '
+ + $db.vnf-related-network-role[$db-related-network-index].related-network-role + ' in vnf-networks'`" />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].is-trunked'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].is-trunked`' />
+ <parameter name='$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].segmentation-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].segmentation-id`' />
+ </set>
+ <set>
+ <parameter name='rn-index' value='`$tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network_length`' />
+ </set>
+ <switch test='`$rn-index`'>
+ <outcome value=''>
+ <set>
+ <parameter name='rn-index' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].network-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].network-id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].network-role'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].network-role`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].vlan-tags.vlan-interface'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].vlan-tags.vlan-interface`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].vlan-tags.lower-tag-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].vlan-tags.lower-tag-id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].vlan-tags.upper-tag-id'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].vlan-tags.upper-tag-id`' />
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network[$rn-index].vlan-tags.is-private'
+ value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$saved-vnf-network-index].related-networks.related-network[$saved-related-network-index].vlan-tags.is-private`' />
+ </set>
+ <set>
+ <parameter name='tmp.vf-module-topology.vf-module-assignments.vms.vm[$vm-type-index].vm-networks.vm-network[$network-role-index].related-networks.related-network_length'
+ value='`$rn-index + 1`' />
+ </set>
+ </block>
+ </for>
+ </outcome>
+ </get-resource>
+ </block>
+ </for>
+ </block>
+ </for>
+ <set>
+ <parameter name='vf-module-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vf-module-topology-operation-input.service-information.service-instance-id
+ + '/service-data/vnfs/vnf/'
+ + $service-data.vnfs.vnf[$vnf-index].vnf-id
+ + '/vnf-data/vf-modules/vf-module/'
+ + $vf-module-topology-operation-input.vf-module-information.vf-module-id
+ + '/vf-module-data/vf-module-topology/'`"/>
+ <parameter name='vnf-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vf-module-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/'
+ + $vf-module-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <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>
+ <call module='GENERIC-RESOURCE-API' rpc='vf-module-generate-heat-parameters' mode='sync' ></call>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vfmoduleheat.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-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>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic> diff --git a/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vf-module-topology-operation-deactivate.xml b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vf-module-topology-operation-deactivate.xml new file mode 100644 index 00000000..4f31a9fe --- /dev/null +++ b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vf-module-topology-operation-deactivate.xml @@ -0,0 +1,156 @@ +<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='aai-disabled'>
+ <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>
+ <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='PendingDelete' />
+ </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/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vnf-topology-operation-activate.xml b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vnf-topology-operation-activate.xml new file mode 100644 index 00000000..78f1abe2 --- /dev/null +++ b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vnf-topology-operation-activate.xml @@ -0,0 +1,64 @@ +<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='aai-disabled'>
+ <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>
+ <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/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vnf-topology-operation-assign-sync.xml b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vnf-topology-operation-assign-sync.xml new file mode 100644 index 00000000..2ad5a468 --- /dev/null +++ b/csit/plans/sdnc/testdata/GENERIC-RESOURCE-API_vnf-topology-operation-assign-sync.xml @@ -0,0 +1,899 @@ +<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='aai-disabled'>
+ <method rpc='vnf-topology-operation-assign-sync' 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.vnf-request-input.cloud-owner`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.cloud-region.cloud-owner' value='`$vnf-topology-operation-input.vnf-request-input.cloud-owner`' />
+ </set>
+ </outcome>
+ </switch>
+ <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>
+ <call module='GENERIC-RESOURCE-API' rpc='self-serve-vnf-forking-logic' mode='sync' ></call>
+ <switch test="`$ss.self-serve-flag`">
+ <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 + ' with error: ' + $error-message`" />
+ </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>
+ <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'
+ 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-information.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-information.vnf-name`" />
+ </set>
+ </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.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'>
+ <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 silentFailure='true' index='role-index' start='0' end='`$db.vf-network-role-mapping_length`'>
+ <switch test='`$db.vf-network-role-mapping[$role-index].network-role`'>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ <outcome value='null'>
+ <block></block>
+ </outcome>
+ <outcome value='NULL'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <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'>
+ <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>
+ </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='service-instance'>
+ <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='service-instance.service-instance-id'>
+ <set>
+ <parameter name='network-service-instance-id'
+ value='`$aai.l3-network.l3-network[$db-network-index].relationship-list.relationship[$db-rel-index].relationship-data[$db-data-index].relationship-value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <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'
+ 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>
+ <switch test='`$aai.l3-network.l3-network[$db-network-index].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[$db-network-index].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`' />
+ <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`' />
+ <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].network-start-address'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].network-start-address`' />
+ <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].gateway-address'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].gateway-address`' />
+ <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].cidr-mask'
+ value='`$aai.l3-network.l3-network[$db-network-index].subnets.subnet[$subnet-index].cidr-mask`' />
+ </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[$db-network-index].subnets.subnet_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from VNF_RELATED_NETWORK_ROLE where vnf_customization_uuid = $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid
+ and network_role = $db.vf-network-role-mapping[$role-index].network-role'
+ pfx='db.vnf-related-network-role[]'>
+ <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 VNF_RELATED_NETWORK_ROLE table" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.network-topology-identifier-structure`"/>
+ <parameter name="outputPath" value="tmp.part"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$network-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.ntis-url"/>
+ <parameter name="target" value="{network-id}"/>
+ <parameter name="replacement" value="`$l3-network-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ntis-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-ntis" />
+ <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 network-topology-identifier-structure for service instance '
+ + $network-service-instance-id
+ + ' and network-id '
+ + $l3-network-id`" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].is-trunked'
+ value='`$mdsal-ntis.network-topology-identifier-structure.is-trunked`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].segmentation-id'
+ value='`$mdsal-ntis.network-topology-identifier-structure.segmentation-id`' />
+ </set>
+ <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=' + $network-service-instance-id `" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="/query/owning-entity-fromService-instance" />
+ <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 getting owning entity from service instance" />
+ </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="Unable to find owning entity from service instance" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='rn-index' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network_length`' />
+ </set>
+ <switch test='`$rn-index`'>
+ <outcome value=''>
+ <set>
+ <parameter name='rn-index' value='0' />
+ </set>
+ </outcome>
+ </switch>
+ <for index='rel-network-role-index' start='0' end='`$db.vnf-related-network-role_length`' >
+ <block atomic="true">
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="custom-query"
+ key="format = 'resource'"
+ force="true"
+ local-only="false"
+ pfx="tmp.AnAI-data.get-networks">
+ <parameter name="start[0]" value="`'/business/owning-entities/owning-entity/' + $tmp.AnAI-data.oe.results[0].owning-entity.owning-entity-id `" />
+ <parameter name="start_length" value="1" />
+ <parameter name="query" value="`'/query/getNetworks?networkRole=' + $db.vnf-related-network-role[$rel-network-role-index].related-network-role
+ + '&cloudRegionId=' + $vnf-topology-operation-input.vnf-request-input.aic-cloud-region`" />
+ <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 calling getNetworks custom query 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 l3-network returned from getNetworks custom query for related network role '
+ + $db.vnf-related-network-role[0].related-network-role`" />
+ </return>
+ </block>
+ </outcome>
+ </save>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].network-id'
+ value='`$tmp.AnAI-data.get-networks.results[0].l3-network.network-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].network-role'
+ value='`$tmp.AnAI-data.get-networks.results[0].l3-network.network-role`' />
+ </set>
+ <for index='rel-index' start='0' end='`$tmp.AnAI-data.get-networks.results[0].l3-network.relationship-list.relationship_length`' >
+ <switch test='`$tmp.AnAI-data.get-networks.results[0].l3-network.relationship-list.relationship[$rel-index].related-to`'>
+ <outcome value='vlan-tag'>
+ <block atomic="true">
+ <set>
+ <parameter name='vlan-tag-id' value='`$tmp.AnAI-data.get-networks.results[0].l3-network.relationship-list.relationship[$rel-index].relationship-data[0].relationship-value`' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="vlan-tag"
+ key="vlan-tag.vlan-tag-id = $vlan-tag-id"
+ pfx='aai.vlan-tag' local-only='false'
+>
+ <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 getting vlan-tag object from AAI" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].vlan-tags.vlan-interface'
+ value='`$aai.vlan-tag.vlan-tag-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].vlan-tags.upper-tag-id'
+ value='`$aai.vlan-tag.vlan-id-outer`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].vlan-tags.lower-tag-id'
+ value='`$aai.vlan-tag.vlan-id-inner`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network[$rn-index].vlan-tags.is-private'
+ value='`$aai.vlan-tag.is-private`' />
+ </set>
+ </outcome>
+ </get-resource>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-resource-assignments.vnf-networks.vnf-network[$network-index].related-networks.related-network_length'
+ value='`$rn-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name='network-index' value='`$network-index + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
+ <parameter name='filename' value='/var/tmp/bgb-vnfa.log' />
+ </execute>
+ <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>
+ <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.cloud-region.availability-zones.availability-zone_length`' />
+ </set>
+ <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/service-topology/'`"/>
+ </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">
+ <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-vnf.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>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/csit/plans/sdnc/testdata/VNF-API_generate-subnets-subnet-id.xml b/csit/plans/sdnc/testdata/VNF-API_generate-subnets-subnet-id.xml new file mode 100644 index 00000000..2486391c --- /dev/null +++ b/csit/plans/sdnc/testdata/VNF-API_generate-subnets-subnet-id.xml @@ -0,0 +1,26 @@ +<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='VNF-API' version='aai-disabled'>
+ <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>
+ <set>
+ <parameter name="tmp.local-variables.generate-subnets-subnet-id." value="" />
+ </set>
+ </block>
+ </method>
+</service-logic> diff --git a/csit/run-csit.sh b/csit/run-csit.sh index 36fdc597..e7cb0054 100755 --- a/csit/run-csit.sh +++ b/csit/run-csit.sh @@ -192,6 +192,8 @@ SUITES=$( xargs -a testplan.txt ) echo ROBOT_VARIABLES="${ROBOT_VARIABLES}" echo "Starting Robot test suites ${SUITES} ..." relax_set +echo "*** TRACE **** python is $(which python) [version $(python --version)]" +env python -m robot.run -N ${TESTPLAN} -v WORKSPACE:/tmp ${ROBOT_VARIABLES} ${TESTOPTIONS} ${SUITES} RESULT=$? load_set diff --git a/csit/scripts/csit-data.sql b/csit/scripts/csit-data.sql new file mode 100644 index 00000000..06c94960 --- /dev/null +++ b/csit/scripts/csit-data.sql @@ -0,0 +1,79 @@ +-- +-- Dumping data for table `SERVICE_MODEL` +-- + +LOCK TABLES `SERVICE_MODEL` WRITE; +/*!40000 ALTER TABLE `SERVICE_MODEL` DISABLE KEYS */; +INSERT INTO `SERVICE_MODEL` VALUES ('00e50cbd-ef0f-4b28-821e-f2b583752dd3','!!com.att.sdnctl.uebclient.SdncNetworkServiceModel\ndescription: null\nimports:\n- Second try_vbng: {file: resource-SecondTryVbng-template.yml}\nmetadata: {invariantUUID: dbf9288d-18ef-4d28-82cb-29373028f367, UUID: 00e50cbd-ef0f-4b28-821e-f2b583752dd3,\n name: vBNG_0202, description: Virtual, type: Service, category: Network L1-3, serviceEcompNaming: false,\n serviceHoming: false}\ntopology_template:\n node_templates:\n Second try_vbng 1:\n type: com.att.d2.resource.vf.SecondTryVbng\n metadata: {invariantUUID: 57516bfc-35f5-4169-a4ee-66a495a9c645, UUID: f196fdad-9b74-4fcc-9d38-72f4a71aea77,\n customizationUUID: 72a9f413-4d16-4f7b-b0bc-d98f87997f01, version: \'1.0\', name: Second try_vbng,\n description: ntwork, type: VF, category: Generic, subcategory: Network Elements}\n groups:\n secondtry_vbng1..SecondTryVbng..VSR_base_hot..module-0:\n type: com.att.d2.groups.VfModule\n metadata: {vfModuleModelName: SecondTryVbng..VSR_base_hot..module-0, vfModuleModelInvariantUUID: b73fcd7d-f374-4e7e-a905-f5e58eb8a34a,\n vfModuleModelUUID: 3b3ff306-b493-4b3d-bb3d-baa13c2d82c7, vfModuleModelVersion: \'1\',\n vfModuleModelCustomizationUUID: d106e920-0188-48b7-9f90-ae7c1ab43b73}\n properties: {min_vf_module_instances: 1, vf_module_label: VSR_base_hot, max_vf_module_instances: 1,\n vf_module_type: Base, vf_module_description: null, volume_group: false, initial_count: 1}\n substitution_mappings:\n node_type: com.att.d2.service.Vbng0202\n capabilities:\n Second try_vbng 1.attachment_iom_ctrl_fabric_0_port:\n type: tosca.capabilities.Attachment\n occurrences: [0, UNBOUNDED]\n Second try_vbng 1.os_CPM:\n type: tosca.capabilities.OperatingSystem\n occurrences: [1, UNBOUNDED]\n properties:\n distribution: {type: string, required: false}\n type: {type: string, required: false}\n version: {type: version, required: false}\n architecture: {type: string, required: false}\n Second try_vbng 1.scalable_CPM:\n type: tosca.capabilities.Scalable\n occurrences: [1, UNBOUNDED]\n properties:\n max_instances: {type: integer, default: 1, required: false}\n min_instances: {type: integer, default: 1, required: false}\n default_instances: {type: integer, required: false}\n Second try_vbng 1.binding_iom_data_0_port:\n type: tosca.capabilities.network.Bindable\n occurrences: [0, UNBOUNDED]\n valid_source_types: [com.att.d2.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface]\n Second try_vbng 1.attachment_iom_mgt_0_port:\n type: tosca.capabilities.Attachment\n occurrences: [0, UNBOUNDED]\n Second try_vbng 1.binding_cpm_ctrl_fabric_0_port:\n type: tosca.capabilities.network.Bindable\n occurrences: [0, UNBOUNDED]\n valid_source_types: [com.att.d2.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface]\n Second try_vbng 1.scalable_IOM:\n type: tosca.capabilities.Scalable\n occurrences: [1, UNBOUNDED]\n properties:\n max_instances: {type: integer, default: 1, required: false}\n min_instances: {type: integer, default: 1, required: false}\n default_instances: {type: integer, required: false}\n Second try_vbng 1.attachment_iom_data_0_port:\n type: tosca.capabilities.Attachment\n occurrences: [0, UNBOUNDED]\n Second try_vbng 1.host_CPM:\n type: tosca.capabilities.Container\n occurrences: [1, UNBOUNDED]\n valid_source_types: [tosca.nodes.SoftwareComponent]\n properties:\n num_cpus: {type: integer, required: false}\n disk_size: {type: scalar-unit.size, required: false}\n cpu_frequency: {type: scalar-unit.frequency, required: false}\n mem_size: {type: scalar-unit.size, required: false}\n Second try_vbng 1.attachment_cpm_mgt_0_port:\n type: tosca.capabilities.Attachment\n occurrences: [0, UNBOUNDED]\n Second try_vbng 1.binding_iom_data_1_port:\n type: tosca.capabilities.network.Bindable\n occurrences: [0, UNBOUNDED]\n valid_source_types: [com.att.d2.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface]\n Second try_vbng 1.attachment_iom_data_3_port:\n type: tosca.capabilities.Attachment\n occurrences: [0, UNBOUNDED]\n Second try_vbng 1.binding_iom_mgt_0_port:\n type: tosca.capabilities.network.Bindable\n occurrences: [0, UNBOUNDED]\n valid_source_types: [com.att.d2.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface]\n Second try_vbng 1.attachment_iom_data_2_port:\n type: tosca.capabilities.Attachment\n occurrences: [0, UNBOUNDED]\n Second try_vbng 1.binding_iom_data_2_port:\n type: tosca.capabilities.network.Bindable\n occurrences: [0, UNBOUNDED]\n valid_source_types: [com.att.d2.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface]\n Second try_vbng 1.endpoint_CPM:\n type: tosca.capabilities.Endpoint.Admin\n occurrences: [1, UNBOUNDED]\n properties:\n port_name: {type: string, required: false}\n protocol: {type: string, default: tcp, required: false}\n port: {type: PortDef, required: false}\n initiator: {type: string, default: source, required: false}\n network_name: {type: string, default: PRIVATE, required: false}\n secure: {type: boolean, default: true, required: false}\n ports:\n type: map\n required: false\n entry_schema: {type: PortSpec}\n url_path: {type: string, required: false}\n Second try_vbng 1.binding_cpm_mgt_0_port:\n type: tosca.capabilities.network.Bindable\n occurrences: [0, UNBOUNDED]\n valid_source_types: [com.att.d2.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface]\n Second try_vbng 1.feature:\n type: tosca.capabilities.Node\n occurrences: [1, UNBOUNDED]\n Second try_vbng 1.binding_IOM:\n type: tosca.capabilities.network.Bindable\n occurrences: [1, UNBOUNDED]\n Second try_vbng 1.attachment_cpm_ctrl_fabric_0_port:\n type: tosca.capabilities.Attachment\n occurrences: [0, UNBOUNDED]\n Second try_vbng 1.binding_iom_ctrl_fabric_0_port:\n type: tosca.capabilities.network.Bindable\n occurrences: [0, UNBOUNDED]\n valid_source_types: [com.att.d2.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface]\n Second try_vbng 1.binding_iom_data_3_port:\n type: tosca.capabilities.network.Bindable\n occurrences: [0, UNBOUNDED]\n valid_source_types: [com.att.d2.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface]\n Second try_vbng 1.binding_CPM:\n type: tosca.capabilities.network.Bindable\n occurrences: [1, UNBOUNDED]\n Second try_vbng 1.attachment_iom_data_1_port:\n type: tosca.capabilities.Attachment\n occurrences: [0, UNBOUNDED]\n Second try_vbng 1.host_IOM:\n type: tosca.capabilities.Container\n occurrences: [1, UNBOUNDED]\n valid_source_types: [tosca.nodes.SoftwareComponent]\n properties:\n num_cpus: {type: integer, required: false}\n disk_size: {type: scalar-unit.size, required: false}\n cpu_frequency: {type: scalar-unit.frequency, required: false}\n mem_size: {type: scalar-unit.size, required: false}\n Second try_vbng 1.os_IOM:\n type: tosca.capabilities.OperatingSystem\n occurrences: [1, UNBOUNDED]\n properties:\n distribution: {type: string, required: false}\n type: {type: string, required: false}\n version: {type: version, required: false}\n architecture: {type: string, required: false}\n Second try_vbng 1.endpoint_IOM:\n type: tosca.capabilities.Endpoint.Admin\n occurrences: [1, UNBOUNDED]\n properties:\n port_name: {type: string, required: false}\n protocol: {type: string, default: tcp, required: false}\n port: {type: PortDef, required: false}\n initiator: {type: string, default: source, required: false}\n network_name: {type: string, default: PRIVATE, required: false}\n secure: {type: boolean, default: true, required: false}\n ports:\n type: map\n required: false\n entry_schema: {type: PortSpec}\n url_path: {type: string, required: false}\n requirements:\n Second try_vbng 1.local_storage_IOM:\n occurrences: [0, UNBOUNDED]\n capability: tosca.capabilities.Attachment\n node: tosca.nodes.BlockStorage\n relationship: tosca.relationships.AttachesTo\n Second try_vbng 1.link_iom_ctrl_fabric_0_port:\n occurrences: [1, 1]\n capability: tosca.capabilities.network.Linkable\n node: tosca.nodes.Root\n relationship: tosca.relationships.network.LinksTo\n Second try_vbng 1.link_cpm_ctrl_fabric_0_port:\n occurrences: [1, 1]\n capability: tosca.capabilities.network.Linkable\n node: tosca.nodes.Root\n relationship: tosca.relationships.network.LinksTo\n Second try_vbng 1.link_cpm_mgt_0_port:\n occurrences: [1, 1]\n capability: tosca.capabilities.network.Linkable\n node: tosca.nodes.Root\n relationship: tosca.relationships.network.LinksTo\n Second try_vbng 1.link_iom_data_3_port:\n occurrences: [1, 1]\n capability: tosca.capabilities.network.Linkable\n node: tosca.nodes.Root\n relationship: tosca.relationships.network.LinksTo\n Second try_vbng 1.local_storage_CPM:\n occurrences: [0, UNBOUNDED]\n capability: tosca.capabilities.Attachment\n node: tosca.nodes.BlockStorage\n relationship: tosca.relationships.AttachesTo\n Second try_vbng 1.dependency:\n occurrences: [0, UNBOUNDED]\n capability: tosca.capabilities.Node\n node: tosca.nodes.Root\n relationship: tosca.relationships.DependsOn\n Second try_vbng 1.link_iom_data_2_port:\n occurrences: [1, 1]\n capability: tosca.capabilities.network.Linkable\n node: tosca.nodes.Root\n relationship: tosca.relationships.network.LinksTo\n Second try_vbng 1.link_iom_data_0_port:\n occurrences: [1, 1]\n capability: tosca.capabilities.network.Linkable\n node: tosca.nodes.Root\n relationship: tosca.relationships.network.LinksTo\n Second try_vbng 1.link_iom_mgt_0_port:\n occurrences: [1, 1]\n capability: tosca.capabilities.network.Linkable\n node: tosca.nodes.Root\n relationship: tosca.relationships.network.LinksTo\n Second try_vbng 1.port:\n occurrences: [0, UNBOUNDED]\n capability: tosca.capabilities.Attachment\n node: com.att.d2.resource.cp.nodes.heat.network.neutron.Port\n relationship: com.att.d2.relationships.AttachesTo\n Second try_vbng 1.link_iom_data_1_port:\n occurrences: [1, 1]\n capability: tosca.capabilities.network.Linkable\n node: tosca.nodes.Root\n relationship: tosca.relationships.network.LinksTo\ntosca_definitions_version: tosca_simple_yaml_1_0\n','dbf9288d-18ef-4d28-82cb-29373028f367',NULL,'vBNG_0202','Virtual','Service','Network L1-3','N','Vbng0202','service-Vbng0202-template.yml',NULL); +/*!40000 ALTER TABLE `SERVICE_MODEL` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `NETWORK_MODEL` +-- + +LOCK TABLES `NETWORK_MODEL` WRITE; +/*!40000 ALTER TABLE `NETWORK_MODEL` DISABLE KEYS */; +INSERT INTO `NETWORK_MODEL` VALUES ('b0cf3385-a390-488c-b6a0-d879fb4a4825','00e50cbd-ef0f-4b28-821e-f2b583752dd3','null','206d5e6c-4cba-4c14-b942-5d946c881869','9b7c1cbe-ddcd-458c-8792-d76391419b72','NEUTRON','VcpesvcVbng0412a.bng_mux','NEUTRON',NULL,NULL,NULL,'Y',NULL,'N',NULL,NULL,'N',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'1.0'); +/*!40000 ALTER TABLE `NETWORK_MODEL` ENABLE KEYS */; +UNLOCK TABLES; +-- +-- Dumping data for table `VFC_MODEL` +-- + +LOCK TABLES `VFC_MODEL` WRITE; +/*!40000 ALTER TABLE `VFC_MODEL` DISABLE KEYS */; +INSERT INTO `VFC_MODEL` VALUES ('8b84aeae-51cf-48c2-8bb1-50c7aa444a16','null','84dfff0d-74df-4782-afc9-8a902db20c89','621eac8e-ade1-4d21-86a4-1a66caf964db','1.0',NULL,'Y',NULL,'vgmux','vgmux','vgmux','vgmux2-base-ubuntu-16-04','m1.medium',NULL,'{ecomp_generated_naming=true}',0,NULL); +/*!40000 ALTER TABLE `VFC_MODEL` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `VFC_TO_NETWORK_ROLE_MAPPING` +-- + +LOCK TABLES `VFC_TO_NETWORK_ROLE_MAPPING` WRITE; +/*!40000 ALTER TABLE `VFC_TO_NETWORK_ROLE_MAPPING` DISABLE KEYS */; +INSERT INTO `VFC_TO_NETWORK_ROLE_MAPPING` VALUES (2034,'8b84aeae-51cf-48c2-8bb1-50c7aa444a16','default-network-role','vgmux','mux_gw_private',0,0,'N',NULL,'4',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `VFC_TO_NETWORK_ROLE_MAPPING` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `VF_MODEL` +-- + +LOCK TABLES `VF_MODEL` WRITE; +/*!40000 ALTER TABLE `VF_MODEL` DISABLE KEYS */; +INSERT INTO `VF_MODEL` VALUES ('5724fcc8-2ae2-45ce-8d44-795092b85dee','null','b3dc6465-942c-42af-8464-2bf85b6e504b','ba3b8981-9a9c-4945-92aa-486234ec321f','1.0','vcpevsp_vgmux_0412',NULL,'Y',1,NULL,NULL,NULL,NULL,'integration','1.0', NULL, NULL, NULL); +/*!40000 ALTER TABLE `VF_MODEL` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `VF_MODULE_MODEL` +-- + +LOCK TABLES `VF_MODULE_MODEL` WRITE; +/*!40000 ALTER TABLE `VF_MODULE_MODEL` DISABLE KEYS */; +INSERT INTO `VF_MODULE_MODEL` VALUES ('59ffe5ba-cfaf-4e83-a2f3-159522dcebac','null','7ca7567c-f42c-4ed8-bcde-f8971b92d90a','513cc9fc-fff5-4c46-9728-393437536c4d','1','Base',NULL,NULL,'5724fcc8-2ae2-45ce-8d44-795092b85dee','base_vcpe_vgmux'); +/*!40000 ALTER TABLE `VF_MODULE_MODEL` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `VF_MODULE_TO_VFC_MAPPING` +-- + +LOCK TABLES `VF_MODULE_TO_VFC_MAPPING` WRITE; +/*!40000 ALTER TABLE `VF_MODULE_TO_VFC_MAPPING` DISABLE KEYS */; +INSERT INTO `VF_MODULE_TO_VFC_MAPPING` VALUES (1668,'59ffe5ba-cfaf-4e83-a2f3-159522dcebac','8b84aeae-51cf-48c2-8bb1-50c7aa444a16','vgmux',1); +/*!40000 ALTER TABLE `VF_MODULE_TO_VFC_MAPPING` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2020-11-02 21:47:47 diff --git a/csit/scripts/docker-compose.yml b/csit/scripts/docker-compose.yml index 13ee963b..4a36dc7a 100755 --- a/csit/scripts/docker-compose.yml +++ b/csit/scripts/docker-compose.yml @@ -8,6 +8,7 @@ services: container_name: mariadb volumes: - /etc/localtime:/etc/localtime:ro + - ../archives/csit-dbinit.sql:/docker-entrypoint-initdb.d/dump.sql environment: - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} - MYSQL_USER=${MYSQL_USER} @@ -64,6 +65,7 @@ services: - ANSIBLE_PASSWORD=${ANSIBLE_PASSWORD} - SQL_CRYPTKEY=${SQL_CRYPTKEY} - A1_TRUSTSTORE_PASSWORD=a1adapter + - KARAF_CONSOLE_LOG_LEVEL=info depends_on: - mariadb dns: diff --git a/csit/sdnc-csit.env b/csit/sdnc-csit.env index d944927f..5176380b 100755 --- a/csit/sdnc-csit.env +++ b/csit/sdnc-csit.env @@ -1,4 +1,5 @@ export SDNC_CONTAINER_NAME=sdnc +export DB_CONTAINER_NAME=mariadb export SDNC_CERT_PATH=${WORKSPACE}/archives/certs export NETCONF_PNP_SIM_CONTAINER_NAME=netconf-simulator export TEMP_DIR_PATH=${WORKSPACE}/tests/netconf_tls_post_deploy/tmp diff --git a/csit/tests/sdnc/resources/grafiles/network-topology-assign.json b/csit/tests/sdnc/resources/grafiles/network-topology-assign.json new file mode 100644 index 00000000..ea1c2789 --- /dev/null +++ b/csit/tests/sdnc/resources/grafiles/network-topology-assign.json @@ -0,0 +1,43 @@ +{ + "input": { + "network-information": { + "onap-model-information": { + "model-name": "VcpesvcVbng0412a.bng_mux", + "model-version": "1.0", + "model-customization-uuid": "b0cf3385-a390-488c-b6a0-d879fb4a4825", + "model-uuid": "9b7c1cbe-ddcd-458c-8792-d76391419b72", + "model-invariant-uuid": "206d5e6c-4cba-4c14-b942-5d946c881869" + }, + "network-id": "2e723205-7f96-49a9-bd60-24168fbd9f07" + }, + "network-request-input": { + "aic-cloud-region": "wnv1a", + "cloud-owner": "att-nc", + "tenant": "1795554216e946af8a3c788f195eb813", + "network-name": "vUSP-23804-T-01-wnv1a_int_csdb_net_1" + }, + "request-information": { + "request-action": "CreateNetworkInstance", + "source": "simulator", + "request-id": "testnet1" + }, + "sdnc-request-header": { + "svc-request-id": "svc-testnet1", + "svc-action": "assign" + }, + "service-information": { + "global-customer-id": "testsvc1", + "onap-model-information": { + "model-customization-uuid": "12341234", + "model-invariant-uuid": "12341234", + "model-name": "vBNG_0202", + "model-uuid": "00e50cbd-ef0f-4b28-821e-f2b583752dd3", + "model-version": "1920" + }, + "service-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "service-instance-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "subscriber-name": "test", + "subscription-service-type": "test" + } + } +} diff --git a/csit/tests/sdnc/resources/grafiles/network-topology-unassign.json b/csit/tests/sdnc/resources/grafiles/network-topology-unassign.json new file mode 100644 index 00000000..8617d706 --- /dev/null +++ b/csit/tests/sdnc/resources/grafiles/network-topology-unassign.json @@ -0,0 +1,46 @@ + +{ + "input": { + "network-information": { + "onap-model-information": { + "model-name": "VcpesvcVbng0412a.bng_mux", + "model-version": "1.0", + "model-customization-uuid": "b0cf3385-a390-488c-b6a0-d879fb4a4825", + "model-uuid": "9b7c1cbe-ddcd-458c-8792-d76391419b72", + "model-invariant-uuid": "206d5e6c-4cba-4c14-b942-5d946c881869" + }, + "network-technology": "", + "network-id": "2e723205-7f96-49a9-bd60-24168fbd9f07", + "network-type": "" + }, + "network-request-input": { + "aic-cloud-region": "wnv1a", + "cloud-owner": "att-nc", + "tenant": "1795554216e946af8a3c788f195eb813", + "network-name": "vUSP-23804-T-01-wnv1a_int_ccfx_net_1" + }, + "request-information": { + "request-action": "DeleteNetworkInstance", + "source": "simulator", + "request-id": "testnet1" + }, + "sdnc-request-header": { + "svc-request-id": "svc-testnet1", + "svc-action": "unassign" + }, + "service-information": { + "global-customer-id": "testsvc1", + "onap-model-information": { + "model-customization-uuid": "12341234", + "model-invariant-uuid": "12341234", + "model-name": "vBNG_0202", + "model-uuid": "00e50cbd-ef0f-4b28-821e-f2b583752dd3", + "model-version": "1920" + }, + "service-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "service-instance-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "subscriber-name": "test", + "subscription-service-type": "test" + } + } +} diff --git a/csit/tests/sdnc/resources/grafiles/preload-network.json b/csit/tests/sdnc/resources/grafiles/preload-network.json new file mode 100644 index 00000000..3819672d --- /dev/null +++ b/csit/tests/sdnc/resources/grafiles/preload-network.json @@ -0,0 +1,91 @@ +{ + "input": { + "preload-network-topology-information": { + "host-routes": [ + { + "next-hop": "10.1.12.1", + "route-prefix": "12" + } + ], + "is-external-network": true, + "is-provider-network": true, + "is-shared-network": true, + "network-policy": [ + { + "network-policy-fqdn": "policy-sdnc.onap.org", + "network-policy-id": "123" + } + ], + "network-topology-identifier-structure": { + "eipam-v4-address-plan": "plan9", + "eipam-v6-address-plan": "plan9v6", + "is-trunked": true, + "network-id": "vUSP-23804-T-01-wnv1a_int_csdb_net_1", + "network-instance-group-id": "abc123", + "network-name": "vUSP-23804-T-01-wnv1a_int_csdb_net_1", + "network-role": "secret", + "network-technology": "soupcan", + "network-type": "fake", + "related-networks": { + "related-network": [ + { + "network-id": "skynet", + "network-role": "master", + "vlan-tags": { + "is-private": true, + "lower-tag-id": 0, + "upper-tag-id": 0, + "vlan-interface": "le0" + } + } + ] + }, + "segmentation-id": "seg1" + }, + "physical-network-name": "skynet", + "route-table-reference": [ + { + "route-table-reference-fqdn": "sky.net", + "route-table-reference-id": "ref1" + } + ], + "subnets": [ + { + "addr-from-start": "Y", + "cidr-mask": "255.255.0.0", + "dhcp-enabled": "Y", + "dhcp-end-address": "10.1.2.254", + "dhcp-start-address": "10.1.2.1", + "gateway-address": "10.1.2.255", + "ip-version": "ipv4", + "start-address": "10.1.2.1", + "subnet-name": "subnet1", + "subnet-role": "puppies", + "subnet-sequence": 0 + } + ], + "vpn-bindings": [ + { + "aic-zone": "zone1", + "global-route-target": "string", + "route-target-role": "string", + "vpn-binding-id": "string", + "vpn-name": "string" + } + ] + }, + "request-information": { + "notification-url": "http://dev.null.com", + "order-number": "123456", + "order-version": "2010.06", + "request-action": "CreateNetworkInstance", + "request-id": "REQ123456", + "source": "curl" + }, + "sdnc-request-header": { + "svc-action": "reserve", + "svc-notification-url": "http://dev.null.com", + "svc-request-id": "SVCREQ123456" + } + } +} diff --git a/csit/tests/sdnc/resources/grafiles/preload-vf-module.json b/csit/tests/sdnc/resources/grafiles/preload-vf-module.json new file mode 100644 index 00000000..ab67f254 --- /dev/null +++ b/csit/tests/sdnc/resources/grafiles/preload-vf-module.json @@ -0,0 +1,375 @@ +{ + "input": { + "preload-vf-module-topology-information": { + "vf-module-topology": { + "aic-clli": "AIC12345", + "aic-cloud-region": "rdm61a", + "cloud-owner": "att-nc", + "onap-model-information": { + "model-customization-uuid": "123123123", + "model-invariant-uuid": "123123123", + "model-name": "frankfurt", + "model-uuid": "121212", + "model-version": "frankfurt" + }, + "sdnc-generated-cloud-resources": true, + "tenant": "tenant", + "vf-module-assignments": { + "dhcp-subnet-assignments": { + "dhcp-subnet-assignment": [ + { + "ip-version": "ipv4", + "network-role": "secret", + "neutron-subnet-id": "sub1" + } + ] + }, + "vf-module-status": "Active", + "vlan-vnfc-instance-groups": { + "vlan-vnfc-instance-group": [ + { + "instance-group-function": "function", + "instance-group-id": "groupid", + "vnf-id": "123", + "vnfcs": { + "vnfc": [ + { + "vnfc-name": "vnc1", + "vnic-groups": { + "vnic-group": [ + { + "network-instance-group-function": "func1", + "vlan-assignment-policy-name": "policy1", + "vlan-common-ip-addresses": { + "ip-addresses": { + "ipv4-address": "10.1.2.1" + } + }, + "vlan-tag-index-next": 0, + "vlan-vnics": { + "vlan-vnic": [ + { + "vnic-port-id": "8080", + "vnic-sub-interfaces": { + "sub-interface-network-data": [ + { + "floating-ips": { + "floating-ip-v4": [ + "10.1.2.1" + ] + }, + "network-id": "string", + "network-information-items": { + "network-information-item": [ + { + "ip-count": 0, + "ip-version": "ipv4", + "network-ips": { + "network-ip": [ + "10.1.2.2" + ] + }, + "use-dhcp": "Y" + } + ] + }, + "network-name": 0, + "network-role": "secret", + "network-role-tag": "tag1", + "neutron-network-id": "net1", + "vlan-tag-id": 0 + } + ] + } + } + ] + }, + "vnic-interface-role": "vnicrole1" + } + ] + } + } + ] + } + } + ] + }, + "vms": { + "vm": [ + { + "nfc-naming-code": "name1", + "onap-model-information": { + "model-customization-uuid": "456456456", + "model-invariant-uuid": "456456456", + "model-name": "model2", + "model-uuid": "678678678", + "model-version": "version2" + }, + "vm-count": 0, + "vm-names": { + "vm-name": [ + "vm1" + ], + "vnfc-names": [ + { + "vnfc-name": "vnc1", + "vnfc-networks": { + "vnfc-network-data": [ + { + "connection-point": { + "connection-point-id": "conn1", + "port-id": "8181", + "vlan-data": [ + { + "vlan-role": "role2", + "vlan-tag-description": "tag2", + "vlan-tag-id": "1", + "vlan-uuid": "78789789" + } + ] + }, + "vnfc-network-role": "role3", + "vnfc-ports": { + "vnfc-port": [ + { + "common-sub-interface-role": "subrole1", + "vnfc-port-id": "8787", + "vnic-sub-interfaces": { + "sub-interface-network-data": [ + { + "floating-ips": { + "floating-ip-v4": [ + "10.1.3.10" + ] + }, + "network-id": "net2", + "network-information-items": { + "network-information-item": [ + { + "ip-count": 0, + "ip-version": "ipv4", + "network-ips": { + "network-ip": [ + "10.1.3.4" + ] + }, + "use-dhcp": "Y" + } + ] + }, + "network-name": 0, + "network-role": "secret", + "network-role-tag": "tag5", + "neutron-network-id": "nnet5", + "vlan-tag-id": 0 + } + ] + } + } + ] + }, + "vnfc-subnet": [ + { + "vnfc-ip-assignments": [ + { + "vnfc-address-family": "ipv4", + "vnfc-subnet-dhcp": "Y", + "vnfc-subnet-ip": [ + { + "ip-type": "FIXED", + "vnfc-client-key": "string", + "vnfc-ip-address": "10.1.7.1" + } + ], + "vnfc-subnet-ip-count": 0 + } + ], + "vnfc-subnet-role": "string" + } + ], + "vnfc-type": "string" + } + ] + } + } + ] + }, + "vm-networks": { + "vm-network": [ + { + "floating-ips": { + "floating-ip-v4": [ + "10.1.9.1" + ] + }, + "interface-route-prefixes": { + "interface-route-prefix": [ + "10" + ] + }, + "is-trunked": true, + "mac-addresses": { + "mac-address": [ + "cafe:beef" + ] + }, + "network-information-items": { + "network-information-item": [ + { + "ip-count": 0, + "ip-version": "ipv4", + "network-ips": { + "network-ip": [ + "10.2.3.10" + ] + }, + "use-dhcp": "Y" + } + ] + }, + "network-role": "secret", + "network-role-tag": "tag9", + "related-networks": { + "related-network": [ + { + "network-id": "net9", + "network-role": "secret", + "vlan-tags": { + "is-private": true, + "lower-tag-id": 0, + "upper-tag-id": 0, + "vlan-interface": "vlan0" + } + } + ] + }, + "segmentation-id": "seg1", + "sriov-parameters": { + "application-tags": { + "c-tags": { + "c-tag": [ + "ctag1" + ] + }, + "s-tags": { + "s-tag": [ + "stag1" + ] + } + }, + "heat-vlan-filters": { + "heat-vlan-filter": [ + "10" + ] + } + } + } + ] + }, + "vm-type": "vgmux", + "vm-type-tag": "vgmux" + } + ] + } + }, + "vf-module-parameters": { + "param": [ + { + "name": "vfmodname", + "resource-resolution-data": { + "capability-name": "cap1", + "payload": "payload1", + "resource-key": [ + { + "name": "key1", + "value": "value1" + } + ], + "status": "active" + }, + "value": "value1" + } + ] + }, + "vf-module-topology-identifier": { + "vf-module-id": "vfmodule1", + "vf-module-name": "vfmodule1", + "vf-module-type": "router" + } + }, + "vnf-resource-assignments": { + "availability-zones": { + "availability-zone": [ + "zone1" + ], + "max-count": 0 + }, + "vnf-networks": { + "vnf-network": [ + { + "contrail-network-fqdn": "skynet.net", + "is-trunked": true, + "network-id": "net1", + "network-name": "net1", + "network-role": "secret", + "neutron-id": "neutron1", + "related-networks": { + "related-network": [ + { + "network-id": "net2", + "network-role": "secret", + "vlan-tags": { + "is-private": true, + "lower-tag-id": 0, + "upper-tag-id": 0, + "vlan-interface": "vlan2" + } + } + ] + }, + "segmentation-id": "seg2", + "subnets-data": { + "subnet-data": [ + { + "cidr-mask": "255.255", + "dhcp-enabled": "Y", + "gateway-address": "10.1.2.254", + "ip-version": "ipv4", + "network-start-address": "10.1.2.1", + "sdnc-subnet-id": "sub1", + "subnet-id": "sub1", + "subnet-name": "sub1", + "subnet-role": "subrole1" + } + ] + } + } + ] + }, + "vnf-status": "active" + }, + "vnf-topology-identifier-structure": { + "nf-code": "code1", + "nf-function": "function1", + "nf-role": "role1", + "nf-type": "type1", + "vnf-id": "preload1", + "vnf-name": "vnf1", + "vnf-type": "vnftype1" + } + }, + "request-information": { + "notification-url": "http://dev.null", + "order-number": "order123", + "order-version": "1", + "request-action": "CreateNetworkInstance", + "request-id": "req001", + "source": "curl" + }, + "sdnc-request-header": { + "svc-action": "reserve", + "svc-notification-url": "http://dev.null", + "svc-request-id": "svcreq001" + } + } +} diff --git a/csit/tests/sdnc/resources/grafiles/svc-topology-assign.json b/csit/tests/sdnc/resources/grafiles/svc-topology-assign.json new file mode 100644 index 00000000..9fe16ca0 --- /dev/null +++ b/csit/tests/sdnc/resources/grafiles/svc-topology-assign.json @@ -0,0 +1,34 @@ +{ + "input": { + "request-information": { + "notification-url": "http://dev.null", + "order-number": "123", + "order-version": "version1", + "request-action": "CreateServiceInstance", + "request-id": "testsvc1", + "source": "simulator" + }, + "sdnc-request-header": { + "svc-action": "assign", + "svc-notification-url": "http://dev.null", + "svc-request-id": "svc-testsvc1" + }, + "service-information": { + "global-customer-id": "testsvc1", + "onap-model-information": { + "model-customization-uuid": "12341234", + "model-invariant-uuid": "12341234", + "model-name": "vBNG_0202", + "model-uuid": "00e50cbd-ef0f-4b28-821e-f2b583752dd3", + "model-version": "1920" + }, + "service-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "service-instance-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "subscriber-name": "test", + "subscription-service-type": "test" + }, + "service-request-input": { + "service-instance-name": "zrdm61asmsf01_svc" + } + } + } diff --git a/csit/tests/sdnc/resources/grafiles/svc-topology-delete.json b/csit/tests/sdnc/resources/grafiles/svc-topology-delete.json new file mode 100644 index 00000000..4663eea4 --- /dev/null +++ b/csit/tests/sdnc/resources/grafiles/svc-topology-delete.json @@ -0,0 +1,34 @@ +{ + "input": { + "request-information": { + "notification-url": "http://dev.null", + "order-number": "123", + "order-version": "version1", + "request-action": "DeleteServiceInstance", + "request-id": "testsvc1", + "source": "simulator" + }, + "sdnc-request-header": { + "svc-action": "delete", + "svc-notification-url": "http://dev.null", + "svc-request-id": "svc-testsvc1" + }, + "service-information": { + "global-customer-id": "testsvc1", + "onap-model-information": { + "model-customization-uuid": "12341234", + "model-invariant-uuid": "12341234", + "model-name": "vcpesvc_vbng_0412a", + "model-uuid": "12eb33fa-b221-4d87-939c-d808b5799a7c", + "model-version": "1933" + }, + "service-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "service-instance-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "subscriber-name": "test", + "subscription-service-type": "test" + }, + "service-request-input": { + "service-instance-name": "zrdm61asmsf01_svc" + } + } + } diff --git a/csit/tests/sdnc/resources/grafiles/vf-module-topology-assign.json b/csit/tests/sdnc/resources/grafiles/vf-module-topology-assign.json new file mode 100644 index 00000000..8e2c7af4 --- /dev/null +++ b/csit/tests/sdnc/resources/grafiles/vf-module-topology-assign.json @@ -0,0 +1,58 @@ +{ + "input":{ + "request-information" : { + "request-action" : "CreateVfModuleInstance", + "source" : "simulator", + "request-id" : "testvfmodule1" + }, + "sdnc-request-header" : { + "svc-request-id" : "svc-testvfmodule1", + "svc-action" : "assign" + }, + "service-information" : { + "global-customer-id": "testsvc1", + "onap-model-information": { + "model-customization-uuid": "12341234", + "model-invariant-uuid": "12341234", + "model-name": "vBNG_0202", + "model-uuid": "00e50cbd-ef0f-4b28-821e-f2b583752dd3", + "model-version": "1920" + }, + "service-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "service-instance-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "subscriber-name": "test", + "subscription-service-type": "test" + }, + "vnf-information" : { + "onap-model-information" : { + "model-name" : "vcpevsp_vgmux_0412 ", + "model-version" : "1.0", + "model-customization-uuid" : "5724fcc8-2ae2-45ce-8d44-795092b85dee", + "model-uuid" : "ba3b8981-9a9c-4945-92aa-486234ec321f", + "model-invariant-uuid" : "b3dc6465-942c-42af-8464-2bf85b6e504b" + }, + "vnf-id" : "afb0dae3-85f0-4804-89a8-063204e61c1c", + "vnf-name" : "zrdm61asmsf01", + "vnf-type" : "SMSF-NC2-578-SVC/SMSF-NC2-578" + }, + "vf-module-information" : { + "onap-model-information" : { + "model-name" : "SmsfNc2578..smsf_base..module-0", + "model-version" : "3", + "model-customization-uuid" : "59ffe5ba-cfaf-4e83-a2f3-159522dcebac", + "model-uuid" : "513cc9fc-fff5-4c46-9728-393437536c4d", + "model-invariant-uuid" : "7ca7567c-f42c-4ed8-bcde-f8971b92d90a" + }, + "vf-module-id" : "45841173-3729-4a1d-a811-a3bde399e22d", + "from-preload" : true, + "vf-module-type" : "SmsfNc2578..smsf_base..module-0" + }, + "vf-module-request-input" : { + "aic-cloud-region" : "rdm61a", + "cloud-owner" : "att-nc", + "tenant" : "4714fe06cc24414c914c51ca0aa1bf84", + "vf-module-name" : "vfmodule1", + "vf-module-input-parameters" : { } + } + } +} diff --git a/csit/tests/sdnc/resources/grafiles/vf-module-topology-unassign.json b/csit/tests/sdnc/resources/grafiles/vf-module-topology-unassign.json new file mode 100644 index 00000000..3825f26d --- /dev/null +++ b/csit/tests/sdnc/resources/grafiles/vf-module-topology-unassign.json @@ -0,0 +1,58 @@ +{ + "input":{ + "request-information" : { + "request-action" : "DeleteVfModuleInstance", + "source" : "simulator", + "request-id" : "testvfmodule1" + }, + "sdnc-request-header" : { + "svc-request-id" : "svc-testvfmodule1", + "svc-action" : "unassign" + }, + "service-information" : { + "global-customer-id": "testsvc1", + "onap-model-information": { + "model-customization-uuid": "12341234", + "model-invariant-uuid": "12341234", + "model-name": "vBNG_0202", + "model-uuid": "00e50cbd-ef0f-4b28-821e-f2b583752dd3", + "model-version": "1920" + }, + "service-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "service-instance-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "subscriber-name": "test", + "subscription-service-type": "test" + }, + "vnf-information" : { + "onap-model-information" : { + "model-name" : "vcpevsp_vgmux_0412 ", + "model-version" : "1.0", + "model-customization-uuid" : "5724fcc8-2ae2-45ce-8d44-795092b85dee", + "model-uuid" : "ba3b8981-9a9c-4945-92aa-486234ec321f", + "model-invariant-uuid" : "b3dc6465-942c-42af-8464-2bf85b6e504b" + }, + "vnf-id" : "afb0dae3-85f0-4804-89a8-063204e61c1c", + "vnf-name" : "zrdm61asmsf01", + "vnf-type" : "SMSF-NC2-578-SVC/SMSF-NC2-578" + }, + "vf-module-information" : { + "onap-model-information" : { + "model-name" : "SmsfNc2578..smsf_base..module-0", + "model-version" : "3", + "model-customization-uuid" : "59ffe5ba-cfaf-4e83-a2f3-159522dcebac", + "model-uuid" : "513cc9fc-fff5-4c46-9728-393437536c4d", + "model-invariant-uuid" : "7ca7567c-f42c-4ed8-bcde-f8971b92d90a" + }, + "vf-module-id" : "45841173-3729-4a1d-a811-a3bde399e22d", + "from-preload" : true, + "vf-module-type" : "SmsfNc2578..smsf_base..module-0" + }, + "vf-module-request-input" : { + "aic-cloud-region" : "rdm61a", + "cloud-owner" : "att-nc", + "tenant" : "4714fe06cc24414c914c51ca0aa1bf84", + "vf-module-name" : "vfmodule1", + "vf-module-input-parameters" : { } + } + } +} diff --git a/csit/tests/sdnc/resources/grafiles/vnf-topology-assign.json b/csit/tests/sdnc/resources/grafiles/vnf-topology-assign.json new file mode 100644 index 00000000..33d8c60e --- /dev/null +++ b/csit/tests/sdnc/resources/grafiles/vnf-topology-assign.json @@ -0,0 +1,47 @@ +{ + "input":{ + "request-information" : { + "request-action" : "CreateVnfInstance", + "source" : "simulator", + "request-id" : "testvnf1" + }, + "sdnc-request-header" : { + "svc-request-id" : "svc-testvnf1", + "svc-action" : "assign" + }, + "service-information" : { + "global-customer-id": "testsvc1", + "onap-model-information": { + "model-customization-uuid": "12341234", + "model-invariant-uuid": "12341234", + "model-name": "vBNG_0202", + "model-uuid": "00e50cbd-ef0f-4b28-821e-f2b583752dd3", + "model-version": "1920" + }, + "service-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "service-instance-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "subscriber-name": "test", + "subscription-service-type": "test" + }, + "vnf-information" : { + "onap-model-information" : { + "model-name" : "vcpevsp_vgmux_0412 ", + "model-version" : "1.0", + "model-customization-uuid" : "5724fcc8-2ae2-45ce-8d44-795092b85dee", + "model-uuid" : "ba3b8981-9a9c-4945-92aa-486234ec321f", + "model-invariant-uuid" : "b3dc6465-942c-42af-8464-2bf85b6e504b" + }, + "vnf-id" : "afb0dae3-85f0-4804-89a8-063204e61c1c", + "vnf-name" : "zrdm61asmsf01", + "vnf-type" : "SMSF-NC2-578-SVC/SMSF-NC2-578" + }, + "vnf-request-input" : { + "aic-cloud-region" : "rdm61a", + "cloud-owner" : "att-nc", + "tenant" : "4714fe06cc24414c914c51ca0aa1bf84", + "vnf-network-instance-group-ids" : [ ], + "vnf-input-parameters" : { }, + "vnf-name" : "zrdm61asmsf01" + } + } +} diff --git a/csit/tests/sdnc/resources/grafiles/vnf-topology-unassign.json b/csit/tests/sdnc/resources/grafiles/vnf-topology-unassign.json new file mode 100644 index 00000000..1e3f348b --- /dev/null +++ b/csit/tests/sdnc/resources/grafiles/vnf-topology-unassign.json @@ -0,0 +1,48 @@ + +{ + "input":{ + "request-information" : { + "request-action" : "DeleteVnfInstance", + "source" : "simulator", + "request-id" : "testvnf1" + }, + "sdnc-request-header" : { + "svc-request-id" : "svc-testvnf1", + "svc-action" : "unassign" + }, + "service-information" : { + "global-customer-id": "testsvc1", + "onap-model-information": { + "model-customization-uuid": "12341234", + "model-invariant-uuid": "12341234", + "model-name": "vBNG_0202", + "model-uuid": "00e50cbd-ef0f-4b28-821e-f2b583752dd3", + "model-version": "1920" + }, + "service-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "service-instance-id": "5c4f2d89-57a3-47e9-b49b-d3c63eb0b3ca", + "subscriber-name": "test", + "subscription-service-type": "test" + }, + "vnf-information" : { + "onap-model-information" : { + "model-name" : "vcpevsp_vgmux_0412 ", + "model-version" : "1.0", + "model-customization-uuid" : "5724fcc8-2ae2-45ce-8d44-795092b85dee", + "model-uuid" : "ba3b8981-9a9c-4945-92aa-486234ec321f", + "model-invariant-uuid" : "b3dc6465-942c-42af-8464-2bf85b6e504b" + }, + "vnf-id" : "afb0dae3-85f0-4804-89a8-063204e61c1c", + "vnf-name" : "zrdm61asmsf01", + "vnf-type" : "SMSF-NC2-578-SVC/SMSF-NC2-578" + }, + "vnf-request-input" : { + "aic-cloud-region" : "rdm61a", + "cloud-owner" : "att-nc", + "tenant" : "4714fe06cc24414c914c51ca0aa1bf84", + "vnf-network-instance-group-ids" : [ ], + "vnf-input-parameters" : { }, + "vnf-name" : "zrdm61asmsf01" + } + } +} diff --git a/csit/tests/sdnc/resources/sdnc-keywords.robot b/csit/tests/sdnc/resources/sdnc-keywords.robot index 7a3df839..76d11401 100644 --- a/csit/tests/sdnc/resources/sdnc-keywords.robot +++ b/csit/tests/sdnc/resources/sdnc-keywords.robot @@ -5,6 +5,7 @@ Resource ./sdnc-properties.robot Library Collections Library RequestsLibrary Library OperatingSystem +Library HttpLibrary.HTTP *** Keywords *** @@ -14,46 +15,50 @@ Create SDNC RESTCONF Session ${auth}= Create List ${ODL_USER} ${ODL_PASSWORD} Create Session sdnc_restconf ${SDNC_RESTCONF_URL} auth=${auth} -Send Post Request And Validate Response - [Documentation] Send POST request to passed URL and validate received response - [Arguments] ${path} ${body} ${resp_code} +Send Post File And Validate Response + [Documentation] POST file contents to OpenDaylight controller + [Arguments] ${url} ${path} ${resp_code} Create SDNC RESTCONF Session + ${body}= Get File ${path} &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json Accept=application/json - ${resp}= POST On Session sdnc_restconf ${path} headers=${headers} json=${body} expected_status=${resp_code} + ${resp}= POST On Session sdnc_restconf ${url} headers=${headers} data=${body} expected_status=200 + ${respjson}= Parse Json ${resp.content} + Should Be Equal As Strings ${respjson['output']['response-code']} ${resp_code} + Send Empty Post Request And Validate Response - [Documentation] Send POST request to passed URL and validate received response - [Arguments] ${path} ${resp_code} + [Documentation] POST with no content to OpenDaylight controller + [Arguments] ${url} ${resp_code} Create SDNC RESTCONF Session &{headers}= Create Dictionary Content-Type=application/json Content-Length=0 Accept=application/json - ${resp}= POST On Session sdnc_restconf ${path} headers=${headers} expected_status=${resp_code} + ${resp}= POST On Session sdnc_restconf ${url} headers=${headers} expected_status=${resp_code} Send Get Request And Validate Response Sdnc - [Documentation] Send request to passed url and validate received response - [Arguments] ${path} ${resp_code} + [Documentation] GET from Opendaylight controller and validate received response + [Arguments] ${url} ${resp_code} CREATE SDNC RESTCONF Session &{headers}= Create Dictionary Content-Type=application/json Accept=application/json - ${resp}= GET On Session sdnc_restconf ${path} headers=${headers} expected_status=${resp_code} + ${resp}= GET On Session sdnc_restconf ${url} headers=${headers} expected_status=${resp_code} Send Get Request And Validate TLS Connection Response - [Documentation] Send request to passed url and validate received response - [Arguments] ${path} ${resp_code} + [Documentation] Create NETCONF mount and validate TLS connection + [Arguments] ${url} ${resp_code} Create SDNC RESTCONF Session ${mount}= Get File ${REQUEST_DATA_PATH}${/}mount.xml &{headers}= Create Dictionary Content-Type=application/xml Accept=application/xml - ${resp}= PUT On Session sdnc_restconf ${path} data=${mount} headers=${headers} expected_status=201 + ${resp}= PUT On Session sdnc_restconf ${url} data=${mount} headers=${headers} expected_status=201 Sleep 30 &{headers1}= Create Dictionary Content-Type=application/json Accept=application/json ${resp1}= GET On Session sdnc_restconf ${PNFSIM_MOUNT_PATH} headers=${headers1} expected_status=${resp_code} Send Delete Request And Validate PNF Mount Deleted - [Documentation] Send request to passed url and validate received response - [Arguments] ${path} ${resp_code} + [Documentation] Disconnect NETCONT mount and validate + [Arguments] ${url} ${resp_code} Create SDNC RESTCONF Session ${mount}= Get File ${REQUEST_DATA_PATH}${/}mount.xml &{headers}= Create Dictionary Content-Type=application/json Accept=application/json - ${deleteresponse}= DELETE On Session sdnc_restconf ${path} data=${mount} headers=${headers} expected_status=${resp_code} + ${deleteresponse}= DELETE On Session sdnc_restconf ${url} data=${mount} headers=${headers} expected_status=${resp_code} Sleep 30 ${del_topology}= DELETE On Session sdnc_restconf ${SDNC_NETWORK_TOPOLOGY} expected_status=${resp_code} ${del_keystore}= DELETE On Session sdnc_restconf ${SDNC_KEYSTORE_CONFIG_PATH} diff --git a/csit/tests/sdnc/resources/sdnc-properties.robot b/csit/tests/sdnc/resources/sdnc-properties.robot index bb618eb0..f548e614 100644 --- a/csit/tests/sdnc/resources/sdnc-properties.robot +++ b/csit/tests/sdnc/resources/sdnc-properties.robot @@ -1,15 +1,19 @@ *** Variables *** - # SDNC Configuration -${ODL_USER} %{ODL_USER} -${ODL_PASSWORD} %{ODL_PASSWORD} -${REQUEST_DATA_PATH} %{REQUEST_DATA_PATH} -${SDNC_CONTAINER_NAME} %{SDNC_CONTAINER_NAME} -${SDNC_RESTCONF_URL} http://localhost:8282/restconf -${SDNC_HEALTHCHECK} /operations/SLI-API:healthcheck/ -${SDNC_KEYSTORE_CONFIG_PATH} /config/netconf-keystore:keystore -${SDNC_NETWORK_TOPOLOGY} /config/network-topology:network-topology -${SDNC_MOUNT_PATH} /config/network-topology:network-topology/topology/topology-netconf/node/PNFDemo -${PNFSIM_MOUNT_PATH} /config/network-topology:network-topology/topology/topology-netconf/node/PNFDemo/yang-ext:mount/turing-machine:turing-machine - - +${ODL_USER} %{ODL_USER} +${ODL_PASSWORD} %{ODL_PASSWORD} +${REQUEST_DATA_PATH} %{REQUEST_DATA_PATH} +${SDNC_CONTAINER_NAME} %{SDNC_CONTAINER_NAME} +${GRA_DATA_DIRECTORY} %{WORKSPACE}/tests/sdnc/resources/grafiles +${SDNC_RESTCONF_URL} http://localhost:8282/restconf +${SDNC_HEALTHCHECK} /operations/SLI-API:healthcheck/ +${SDNC_KEYSTORE_CONFIG_PATH} /config/netconf-keystore:keystore +${SDNC_NETWORK_TOPOLOGY} /config/network-topology:network-topology +${SDNC_MOUNT_PATH} /config/network-topology:network-topology/topology/topology-netconf/node/PNFDemo +${PNFSIM_MOUNT_PATH} /config/network-topology:network-topology/topology/topology-netconf/node/PNFDemo/yang-ext:mount/turing-machine:turing-machine +${GRA_PRELOAD_NETWORK} /operations/GENERIC-RESOURCE-API:preload-network-topology-operation/ +${GRA_PRELOAD_VFMODULE} /operations/GENERIC-RESOURCE-API:preload-vf-module-topology-operation/ +${GRA_SERVICE_TOPOLOGY} /operations/GENERIC-RESOURCE-API:service-topology-operation/ +${GRA_NETWORK_TOPOLOGY} /operations/GENERIC-RESOURCE-API:network-topology-operation/ +${GRA_VNF_TOPOLOGY} /operations/GENERIC-RESOURCE-API:vnf-topology-operation/ +${GRA_VFMODULE_TOPOLOGY} /operations/GENERIC-RESOURCE-API:vf-module-topology-operation/ diff --git a/csit/tests/sdnc/sdnc_csit.robot b/csit/tests/sdnc/sdnc_csit.robot index bd1479a6..957a95f1 100644 --- a/csit/tests/sdnc/sdnc_csit.robot +++ b/csit/tests/sdnc/sdnc_csit.robot @@ -28,3 +28,55 @@ Check Dropping NETCONF/TLS Connection [Documentation] Checking PNF Simulator Mount Delete from SDNC Send Delete Request And Validate PNF Mount Deleted ${SDNC_MOUNT_PATH} 200 +Load network preload data + [Tags] SDNC-GRA-PRELOAD-NETWORK + [Documentation] Loading network preload data + Send Post File And Validate Response ${GRA_PRELOAD_NETWORK} ${GRA_DATA_DIRECTORY}/preload-network.json 200 + +Load vf-module preload data + [Tags] SDNC-GRA-PRELOAD-VF-MODULE + [Documentation] Loading vf-module preload data + Send Post File And Validate Response ${GRA_PRELOAD_VFMODULE} ${GRA_DATA_DIRECTORY}/preload-vf-module.json 200 + +Check GRA service assign + [Tags] SDNC-GRA-SERVICE-ASSIGN + [Documentation] Testing GRA service assign + Send Post File And Validate Response ${GRA_SERVICE_TOPOLOGY} ${GRA_DATA_DIRECTORY}/svc-topology-assign.json 200 + +Check GRA network assign + [Tags] SDNC-GRA-NETWORK-ASSIGN + [Documentation] Testing GRA network assign + Send Post File And Validate Response ${GRA_NETWORK_TOPOLOGY} ${GRA_DATA_DIRECTORY}/network-topology-assign.json 200 + +Check GRA vnf assign + [Tags] SDNC-GRA-VNF-ASSIGN + [Documentation] Testing GRA vnf assign + Send Post File And Validate Response ${GRA_VNF_TOPOLOGY} ${GRA_DATA_DIRECTORY}/vnf-topology-assign.json 200 + +Check GRA vf-module assign + [Tags] SDNC-GRA-VF-MODULE-ASSIGN + [Documentation] Testing GRA vf-module assign + Send Post File And Validate Response ${GRA_VFMODULE_TOPOLOGY} ${GRA_DATA_DIRECTORY}/vf-module-topology-assign.json 200 + +Check GRA vf-module unassign + [Tags] SDNC-GRA-VF-MODULE-UNASSIGN + [Documentation] Testing GRA vf-module unassign + Send Post File And Validate Response ${GRA_VFMODULE_TOPOLOGY} ${GRA_DATA_DIRECTORY}/vf-module-topology-unassign.json 200 + +Check GRA vnf unassign + [Tags] SDNC-GRA-VNF-UNASSIGN + [Documentation] Testing GRA vnf unassign + Send Post File And Validate Response ${GRA_VNF_TOPOLOGY} ${GRA_DATA_DIRECTORY}/vnf-topology-unassign.json 200 + +Check GRA network unassign + [Tags] SDNC-GRA-NETWORK-UNASSIGN + [Documentation] Testing GRA network unassign + Send Post File And Validate Response ${GRA_NETWORK_TOPOLOGY} ${GRA_DATA_DIRECTORY}/network-topology-unassign.json 200 + +Check GRA service delete + [Tags] SDNC-GRA-SERVICE-DELETE + [Documentation] Testing GRA service delete + Send Post File And Validate Response ${GRA_SERVICE_TOPOLOGY} ${GRA_DATA_DIRECTORY}/svc-topology-delete.json 200 + + + diff --git a/installation/sdnc/src/main/resources/sdnctl.dump b/installation/sdnc/src/main/resources/sdnctl.dump index 72fdc857..fd13d372 100644 --- a/installation/sdnc/src/main/resources/sdnctl.dump +++ b/installation/sdnc/src/main/resources/sdnctl.dump @@ -2640,6 +2640,9 @@ CREATE TABLE `VF_MODEL` ( `nf_role` varchar(255) DEFAULT NULL, `vendor` varchar(255) DEFAULT NULL, `vendor_version` varchar(255) DEFAULT NULL, + `sdnc_model_name` varchar(255) DEFAULT NULL, + `sdnc_model_version` varchar(255) DEFAULT NULL, + `sdnc_artifact_name` varchar(255) DEFAULT NULL, PRIMARY KEY (`customization_uuid`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; @@ -2660,6 +2663,8 @@ CREATE TABLE `VF_MODULE_MODEL` ( `vf_module_type` varchar(255) DEFAULT NULL, `availability_zone_count` int(11) DEFAULT NULL, `ecomp_generated_vm_assignments` char(1) DEFAULT NULL, + `vf_customization_uuid` varchar(255) DEFAULT NULL, + `vf_module_label` varchar(255) DEFAULT NULL, PRIMARY KEY (`customization_uuid`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; diff --git a/installation/src/main/properties/generic-resource-api-dg.properties b/installation/src/main/properties/generic-resource-api-dg.properties index 980a2819..b29d3c08 100644 --- a/installation/src/main/properties/generic-resource-api-dg.properties +++ b/installation/src/main/properties/generic-resource-api-dg.properties @@ -1,7 +1,7 @@ restapi.templateDir=/opt/onap/sdnc/restapi/templates controller.url=http://localhost:8181 controller.user=${ODL_USER} -controller.pwd=${ODL_HOST} +controller.pwd=${ODL_PASSWORD} honeycomb.url=http://{honeycomb-instance-ip}:8183 honeycomb.user=${HONEYCOMB_USER} honeycomb.pwd=${HONEYCOMB_PASSWORD} |