summaryrefslogtreecommitdiffstats
path: root/platform-logic/generic-resource-api/src/main/xml
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2017-11-01 15:31:08 -0400
committerDan Timoney <dtimoney@att.com>2017-11-01 15:31:08 -0400
commit9a1267e79c232b949f666cc130ebb9837f594090 (patch)
tree4a2445a07ae87d9b58c83ed55185725795c933de /platform-logic/generic-resource-api/src/main/xml
parent817f1f33ddffb9ae86a77613439c50ff2059859f (diff)
Updates to tunnelxconn assignment
Update tunnelxconn assignment logic to assign IP address and VNI from local inventory Change-Id: I1aae9162d1eb7a61d641b620488d52abdfe32357 Issue-ID: SDNC-160 Signed-off-by: Dan Timoney <dtimoney@att.com> Former-commit-id: a7e7279c379e470c1cf7446099fbc11b66fd2ac8
Diffstat (limited to 'platform-logic/generic-resource-api/src/main/xml')
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_manage-ipaddr-assignment.xml16
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_manage-vni-assignment.xml16
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-assign.xml601
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-tunnelxconn-input.xml6
4 files changed, 310 insertions, 329 deletions
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_manage-ipaddr-assignment.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_manage-ipaddr-assignment.xml
new file mode 100644
index 00000000..58bdf73b
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_manage-ipaddr-assignment.xml
@@ -0,0 +1,16 @@
+<!--Reserve/release VNI--><service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='manage-ipaddr-assignment' mode='sync'>
+<block atomic='true'><set>
+<parameter name='tmp.sql.plugin' value='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' />
+</set><switch test='$tmp.manage-vni.action'>
+<outcome value='reserve'>
+<block atomic='true'><get-resource plugin='`$tmp.sql.plugin`' resource='VNI' key="SELECT min(ipv4_addr) from IPV4_ADDRESS_POOL where universe='VGW' and status='AVAILABLE'" pfx="tmp.manage-ipaddr.results" >
+<outcome value='success'>
+<block>
+<set>
+<parameter name='tmp.manage-ipaddr.ip' value='`$tmp.manage-ipaddr.results.ipv4_addr`' />
+</set><save plugin='`$tmp.sql.plugin`' resource='IPADDR' key="UPDATE IPV4_ADDRESS_POOL set status='RESERVED' where universe='VGW' and ipv4_addr=$tmp.manage-ipaddr.ip" force='false'>
+
+</save></block></outcome></get-resource></block></outcome><outcome value='release'>
+<save plugin='`$tmp.sql.plugin`' resource='IPADDR' key="UPDATE IPV4_ADDRESS_POOL set status='AVAILABLE' where universe='VGW' and ipv4_addr=$tmp.manage-ipaddr.ip" force='false'>
+
+</save></outcome></switch></block></method></service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_manage-vni-assignment.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_manage-vni-assignment.xml
new file mode 100644
index 00000000..a1a90d7e
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_manage-vni-assignment.xml
@@ -0,0 +1,16 @@
+<!--Reserve/release VNI--><service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='manage-vni-assignment' mode='sync'>
+<block atomic='true'><set>
+<parameter name='tmp.sql.plugin' value='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' />
+</set><switch test='$tmp.manage-vni.action'>
+<outcome value='reserve'>
+<block atomic='true'><get-resource plugin='`$tmp.sql.plugin`' resource='VNI' key="SELECT min(vlan_id) from VLAN_ID_POOL where purpose='VNI' and status='AVAILABLE'" pfx="tmp.manage-vni.results" >
+<outcome value='success'>
+<block>
+<set>
+<parameter name='tmp.manage-vni.vni' value='`$tmp.manage-vni.results.vlan-id`' />
+</set><save plugin='`$tmp.sql.plugin`' resource='VNI' key="UPDATE VLAN_ID_POOL set status='RESERVED' where purpose='VNI' and vlan_id=$tmp.manage-vni.vni" force='false'>
+
+</save></block></outcome></get-resource></block></outcome><outcome value='release'>
+<save plugin='`$tmp.sql.plugin`' resource='VNI' key="UPDATE VLAN_ID_POOL set status='AVAILABLE' where purpose='VNI' and vlan_id=$tmp.manage-vni.vni" force='false'>
+
+</save></outcome></switch></block></method></service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-assign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-assign.xml
index 419a32cb..963e5cd4 100644
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-assign.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-assign.xml
@@ -1,326 +1,275 @@
-<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
- <method rpc='tunnelxconn-topology-operation-assign' mode='sync'>
- <block atomic="true">
- <set>
- <parameter name='tmp.ar.allotted-resource-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
- <parameter name='tmp.ar.parent-service-instance-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
- </set>
- <set>
- <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:tunnelxconn-allotted-resources/tunnelxconn-allotted-resource/'
- + $tmp.ar.allotted-resource-id
- + '/allotted-resource-data/tunnelxconn-topology/'` " />
- </set>
- <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
- <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
- <parameter name='contextPrefix' value='prop' />
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$prop.restapi.tx-allottedresource`"/>
- <parameter name="outputPath" value="tmp.ar-url"/>
- <parameter name="target" value="{allotted-resource-id}"/>
- <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
- </execute>
- <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='GENERIC-RESOURCE-API' key='tunnelxconn-allotted-resources/tunnelxconn-allotted-resource/$tunnelxconn-topology-operation-input.alloted-resource-information.allotted-resource-id' pfx='mdsal-ar' >
- <outcome value='success'>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message"
- value="`'Existing tunnelxconn-allotted-resource with order status of ' + $mdsal-ar.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`" />
- </return>
- </outcome>
- <outcome value='Other'>
- <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='GENERIC-RESOURCE-API' key='services/service/$tmp.ar.parent-service-instance-id' pfx='mdsal-parent-service-instance' >
- <outcome value='success'>
- <block atomic="true">
- <set>
- <parameter name='tx-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
- <parameter name='tx-ar.allotted-resource-status.action' value="`$tunnelxconn-topology-operation-input.request-information.request-action` " />
- <parameter name='tx-ar.allotted-resource-status.rpc-name' value="tunnelxconn-topology-operation" />
- <parameter name='tx-ar.allotted-resource-status.rpc-action' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action` " />
- <parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$tunnelxconn-topology-operation-input.request-information.` " />
- <parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.` " />
- <parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$tunnelxconn-topology-operation-input.service-information.` " />
- <parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.` " />
- <parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.' value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.` " />
- </set>
- <set>
- <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
- <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tx-ar.allotted-resource-status.rpc-action`' />
- <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
- </set>
- <set>
- <parameter name='tx-ar-identifiers.consuming-service-instance-id' value="`$tunnelxconn-topology-operation-input.service-information.service-instance-id` " />
- <parameter name='tx-ar-identifiers.parent-service-instance-id' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id` " />
- <parameter name='tx-ar-identifiers.allotted-resource-type' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-type` " />
- <parameter name='tx-ar-identifiers.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
- </set>
- <set>
- <parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.onap-model-information.'
- value="`$tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.`" />
- </set>
- <switch test='$tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.model-invariant-uuid'>
- <outcome value=''>
- <set>
- <parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.onap-model-information.model-invariant-uuid'
- value="`$ar-model.invariant-uuid`" />
- </set>
- </outcome>
- </switch>
- <switch test='$tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.model-uuid'>
- <outcome value=''>
- <set>
- <parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.onap-model-information.model-uuid'
- value="`$ar-model.uuid`" />
- </set>
- </outcome>
- </switch>
- <switch test='$tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.model-version'>
- <outcome value=''>
- <set>
- <parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.onap-model-information.model-version'
- value="`$ar-model.version`" />
- </set>
- </outcome>
- </switch>
- <switch test='`$ar-model.ecomp-generated-naming`'>
- <outcome value='Y'>
- <block atomic="true">
- <switch test='`$ar-model.naming-policy`'>
- <outcome value='oam_network_policy'>
- <block atomic='true'>
- <set>
- <parameter name='tmp.ar-name' value='$TenantOAMNetworkRole_$LandingNetworkRole_SZ' />
- </set>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.ar-name`"/>
- <parameter name="outputPath" value="tmp.ar-name"/>
- <parameter name="target" value="$TenantOAMNetworkRole"/>
- <parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.untrusted-network-role`"/>
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.ar-name`"/>
- <parameter name="outputPath" value="tmp.ar-name"/>
- <parameter name="target" value="$LandingNetworkRole"/>
- <parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.trusted-network-role`"/>
- </execute>
- <set>
- <parameter name='tx-ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
- </set>
- </block>
- </outcome>
- <outcome value='Other'>
- <block atomic='true'>
- <set>
- <parameter name='tmp.ar-name' value='$TenantOAMNetworkRole_$LandingNetworkRole_SZ' />
- </set>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.ar-name`"/>
- <parameter name="outputPath" value="tmp.ar-name"/>
- <parameter name="target" value="$TenantOAMNetworkRole"/>
- <parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.untrusted-network-role`"/>
- </execute>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
- <parameter name="source" value="`$tmp.ar-name`"/>
- <parameter name="outputPath" value="tmp.ar-name"/>
- <parameter name="target" value="$LandingNetworkRole"/>
- <parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.trusted-network-role`"/>
- </execute>
- <set>
- <parameter name='tx-ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
- </set>
- </block>
- </outcome>
- </switch>
- </block>
- </outcome>
- <outcome value='Other'>
- <return status='failure'>
- <parameter name='ack-final' value='Y' />
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error in allotted-resource-model data. Ecomp-generated-naming should be true" />
- </return>
- </outcome>
- </switch>
- <set>
- <parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.allotted-resource-identifiers.' value="`$tx-ar-identifiers.`" />
- </set>
- <set>
- <parameter name='tmp.vni' value='123' />
- <parameter name='tmp.vgmux-bearer-ip' value='127.0.0.1' />
- <parameter name='tmp.vgmux-lan-ip' value='127.0.0.1' />
- </set>
- <for index='curparm' start='0' end='`$parent-service-instance.service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameter.param_length`' >
- <switch test='$parent-service-instance.service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameter.param[$curparm].name'>
- <outcome value='vGMUX_Bearer_IP'>
- <set>
- <parameter name='tmp.vgmux-bearer-ip' value='`$parent-service-instance.service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameter.param[$curparm].value`'/>
- </set>
- </outcome>
- <outcome value='vGMUX_LAN_IP'>
- <set>
- <parameter name='tmp.vgmux-lan-ip' value='`$parent-service-instance.service-data.vnfs.vnf[0].vnf-data.vf-modules.vf-module[0].vf-module-data.vf-module-topology.vf-module-parameter.param[$curparm].value`'/>
- </set>
- </outcome>
- </switch>
- </for>
- <set>
- <parameter name='tx-ar-assignments.vni' value='`$tmp.vni`' />
- <parameter name='tx-ar-assignments.vgmux-bearer-ip' value='`$tmp.vgmux-bearer-ip`' />
- <parameter name='tx-ar-assignments.vgmux-lan-ip' value='`$tmp.vgmux-lan-ip`' />
- </set>
- <set>
- <parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.'
- value="`$tx-ar-assignments.`" />
- </set>
- <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'>
- <outcome value=''>
- <set>
- <parameter name='tmp.cidx' value="`0`" />
- <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value="1" />
- </set>
- </outcome>
- <outcome value='Other'>
- <block atomic="true">
- <for index='cidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' >
- <switch test="`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].allotted-resource-id == $tmp.ar.allotted-resource-id`">
- <outcome value='true'>
- <block atomic="true">
- <set>
- <parameter name='tmp.cidx' value='`$cidx`' />
- <parameter name='ctx.consumed-ar.' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].`' />
- <parameter name='tmp.found-cidx' value='true' />
- </set>
- <break></break>
- </block>
- </outcome>
- </switch>
- </for>
- <switch test='`$tmp.found-cidx`'>
- <outcome value='false'>
- <block atomic="true">
- <set>
- <parameter name='tmp.cidx' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' />
- </set>
- </block>
- </outcome>
- </switch>
- </block>
- </outcome>
- </switch>
- <set>
- <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
- <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-type' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-type` " />
- <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-pointer' value="`$tmp.ar.self-link` " />
- <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value='`$tmp.cidx + 1`' />
- </set>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
- <parameter name="outputPath" value="tmp.current-time" />
- </execute>
- <set>
- <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingCreate' />
- <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tunnelxconn-topology-operation-input.request-information.request-action`' />
- <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action`' />
- <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-request-id`' />
- <parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
- </set>
- <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="allotted-resource"
- key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
- service-subscription.service-type = $service-data.service-information.subscription-service-type AND
- service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
- allotted-resource.id = $tmp.ar.allotted-resource-id"
- pfx='pfx' local-only='false' force='false'>
- <parameter name="description" value="`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-type`" />
- <parameter name="selflink" value="`$tmp.ar.self-link`" />
- <parameter name="model-invariant-id" value="`$ar-model.invariant-uuid`" />
- <parameter name="model-version-id" value="`$ar-model.uuid`" />
- <parameter name="operational-status" value="null" />
- <outcome value='failure'>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="AAI failed" />
- </return>
- </outcome>
- <outcome value='not-found'>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="AAI failed" />
- </return>
- </outcome>
- </update>
- <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.tx.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='PUT' />
- <parameter name="responsePrefix" value="mdsal-ar" />
- <outcome value='success'>
- <block>
- <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" />
- <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' />
- <parameter name='restapiUser' value='`$prop.controller.user`' />
- <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
- <parameter name='format' value='json' />
- <parameter name='httpMethod' value='DELETE' />
- <parameter name="responsePrefix" value="parent" />
- <outcome value='success'>
- <block></block>
- </outcome>
- <outcome value='failure'>
- <block></block>
- </outcome>
- <outcome value='not-found'>
- <block></block>
- </outcome>
- </execute>
- </block>
- </outcome>
- <outcome value='failure'>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
- </return>
- </outcome>
- <outcome value='not-found'>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
- </return>
- </outcome>
- </execute>
- <set>
- <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
- <parameter name='tunnelxconn-object-path' value="`$tmp.ar.self-link`"/>
- <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
- + $tunnelxconn-topology-operation-input.service-information.service-instance-id
- + '/service-data/service-topology/'`"/>
- </set>
- <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='Other'>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message"
- value="`'No entry found for parent service instance id ' + $tmp.ar.parent-service-instance-id + '.'`" />
- </return>
- </outcome>
- </get-resource>
- </outcome>
- </get-resource>
- </block>
- </method>
-</service-logic>
+<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='tunnelxconn-topology-operation-assign' mode='sync'>
+<block atomic="true"><set>
+<parameter name='tmp.ar.allotted-resource-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+<parameter name='tmp.ar.parent-service-instance-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+
+
+</set><set>
+<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:tunnelxconn-allotted-resources/tunnelxconn-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/tunnelxconn-topology/'` " />
+
+</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.tx-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Existing tunnelxconn-allotted-resource with order status of ' + $mdsal-ar.tunnelxconn-allotted-resource.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`" />
+</return></outcome><outcome value='Other'>
+<get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='VNF-API' key='vnfs/vnf-list/$tmp.ar.parent-service-instance-id/' pfx='parent-service-instance' >
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='tx-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='tx-ar.allotted-resource-status.action' value="`$tunnelxconn-topology-operation-input.request-information.request-action` " />
+<parameter name='tx-ar.allotted-resource-status.rpc-name' value="tunnelxconn-topology-operation" />
+<parameter name='tx-ar.allotted-resource-status.rpc-action' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$tunnelxconn-topology-operation-input.request-information.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$tunnelxconn-topology-operation-input.service-information.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.` " />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.' value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.` " /></set><set>
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tx-ar.allotted-resource-status.rpc-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$tx-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set><set>
+<parameter name='tx-ar-identifiers.consuming-service-instance-id' value="`$tunnelxconn-topology-operation-input.service-information.service-instance-id` " />
+<parameter name='tx-ar-identifiers.parent-service-instance-id' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id` " />
+<parameter name='tx-ar-identifiers.allotted-resource-type' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-type` " />
+<parameter name='tx-ar-identifiers.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+
+</set><set>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.onap-model-information.'
+value="`$tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.`" />
+
+
+</set><switch test='$tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.model-invariant-uuid'>
+<outcome value=''>
+<set>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.onap-model-information.model-invariant-uuid'
+value="`$ar-model.invariant-uuid`" />
+
+
+</set></outcome></switch><switch test='$tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.model-uuid'>
+<outcome value=''>
+<set>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.onap-model-information.model-uuid'
+value="`$ar-model.uuid`" />
+
+
+</set></outcome></switch><switch test='$tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.model-version'>
+<outcome value=''>
+<set>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.onap-model-information.model-version'
+value="`$ar-model.version`" />
+
+
+</set></outcome></switch><switch test='`$ar-model.ecomp-generated-naming`'>
+<outcome value='Y'>
+<block atomic="true">
+<switch test='`$ar-model.naming-policy`'>
+<outcome value='oam_network_policy'>
+<block atomic='true'>
+<set>
+<parameter name='tmp.ar-name' value='$TenantOAMNetworkRole_$LandingNetworkRole_SZ' />
+</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$TenantOAMNetworkRole"/>
+ <parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.untrusted-network-role`"/>
+
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$LandingNetworkRole"/>
+ <parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.trusted-network-role`"/>
+
+</execute><set>
+<parameter name='tx-ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
+</set></block></outcome><outcome value='Other'>
+<block atomic='true'>
+<set>
+<parameter name='tmp.ar-name' value='$TenantOAMNetworkRole_$LandingNetworkRole_SZ' />
+</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$TenantOAMNetworkRole"/>
+ <parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.untrusted-network-role`"/>
+
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$LandingNetworkRole"/>
+ <parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.trusted-network-role`"/>
+
+</execute><set>
+<parameter name='tx-ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error in allotted-resource-model data. Ecomp-generated-naming should be true" />
+
+</return></outcome></switch><set>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.allotted-resource-identifiers.' value="`$tx-ar-identifiers.`" />
+
+
+</set><set>
+<parameter name='tmp.vni' value='123' />
+<parameter name='tmp.vgmux-bearer-ip' value='127.0.0.1' />
+<parameter name='tmp.vgmux-lan-ip' value='127.0.0.1' /></set><switch test="$parent-service-instance.service-data.vnf-topology.vnf-parameters_length != ''">
+<outcome value='true'>
+<for index='curparm' start='0' end='`$parent-service-instance.service-data.vnf-topology.vnf-parameters_length`' >
+<switch test='$parent-service-instance.service-data.vnf-topology.vnf-parameters[$curidx].vnf-parameter-name'>
+<outcome value='vgmux_private_ip_0'>
+<set>
+<parameter name='tmp.vgmux-bearer-ip' value='`$parent-service-instance.service-data.vnf-topology.vnf-parameters[$curidx].vnf-parameter-value`'/>
+
+</set></outcome><outcome value='vgmux_private_ip_2'>
+<set>
+<parameter name='tmp.vgmux-lan-ip' value='`$parent-service-instance.service-data.vnf-topology.vnf-parameters[$curidx].vnf-parameter-value`'/>
+
+</set></outcome></switch></for></outcome></switch><set>
+<parameter name='tmp.manage-vni.action' value='reserve' />
+<parameter name='tmp.manage-ipaddr.action' value='reserve' />
+<parameter name='tmp.manage-vni.pool' value='VNI'/>
+<parameter name='tmp.manage-ipaddr.pool' value='VGW'/></set><call module='GENERIC-RESOURCE-API' rpc='manage-vni-assignment' mode='sync' >
+</call><call module='GENERIC-RESOURCE-API' rpc='manage-ipaddr-assignment' mode='sync' >
+</call><set>
+<parameter name='tx-ar-assignments.vni' value='`$tmp.manage-vni.vni`'/>
+<parameter name='tx-ar-assignments.vgmux-bearer-ip' value='`$tmp.vgmux-bearer-ip`'/>
+<parameter name='tx-ar-assignments.vgmux-lan-ip' value='`$tmp.vgmux-lan-ip`'/>
+<parameter name='tx-ar-assignments.vgw-private-ip-0' value='`$tmp.manage-ipaddr.ip`'/>
+
+</set><set>
+<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.'
+value="`$tx-ar-assignments.`" />
+
+
+</set><switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'>
+<outcome value=''>
+<set>
+<parameter name='tmp.cidx' value="`0`" />
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value="1" />
+
+
+</set></outcome><outcome value='Other'>
+<block atomic="true"><for index='cidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' >
+<switch test="`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].allotted-resource-id == $tmp.ar.allotted-resource-id`">
+
+<outcome value='true'>
+<block atomic="true"><set>
+<parameter name='tmp.cidx' value='`$cidx`' />
+<parameter name='ctx.consumed-ar.' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].`' />
+<parameter name='tmp.found-cidx' value='true' /></set></block></outcome></switch></for><switch test='`$tmp.found-cidx`'>
+<outcome value='false'>
+<block atomic="true"><set>
+<parameter name='tmp.cidx' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' />
+</set></block></outcome></switch></block></outcome></switch><set>
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-type' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-type` " />
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-pointer' value="`$tmp.ar.self-link` " />
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value='`$tmp.cidx + 1`' />
+
+</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+
+</execute><set>
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingCreate' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tunnelxconn-topology-operation-input.request-information.request-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-request-id`' />
+<parameter name='tx-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+</set><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="description" value="`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-type`" />
+ <parameter name="selflink" value="`$tmp.ar.self-link`" />
+ <parameter name="model-invariant-id" value="`$ar-model.invariant-uuid`" />
+ <parameter name="model-version-id" value="`$ar-model.uuid`" />
+ <parameter name="operational-status" value="null" />
+<outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+</return></outcome><outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+</return></outcome></update><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.tx.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="parent" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<block>
+</block></outcome><outcome value='not-found'>
+<block>
+</block></outcome></execute></block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+</return></outcome><outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
+</return></outcome></execute><set>
+<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+<parameter name='tunnelxconn-object-path' value="`$tmp.ar.self-link`"/>
+<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $tunnelxconn-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+
+</set><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='Other'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'No entry found for parent service instance id ' + $tmp.ar.parent-service-instance-id + '.'`" />
+</return></outcome></get-resource></outcome></execute></block></method></service-logic> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-tunnelxconn-input.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-tunnelxconn-input.xml
index 11d99729..907f7342 100644
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-tunnelxconn-input.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-tunnelxconn-input.xml
@@ -35,11 +35,11 @@
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="tunnelxconn-information.onap-model-information.model-customization-uuid is a required input" />
-</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.brg-wan-mac-address`'>
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.brg-wan-mac-address`'>
<outcome value=''><return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
- <parameter name="error-message" value="tunnelxconn-topology-operation-input.tunnelxconn-request-input.vlan-tag is a required input" />
+ <parameter name="error-message" value="tunnelxconn-topology-operation-input.brg-wan-mac-address is a required input" />
</return></outcome></switch><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key='SELECT * from ALLOTTED_RESOURCE_MODEL WHERE customization_uuid = $tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid'
pfx='ar-model'>
@@ -103,4 +103,4 @@
<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>
+</return></block></method></service-logic> \ No newline at end of file