diff options
author | Dan Timoney <dtimoney@att.com> | 2017-09-27 09:22:48 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-09-27 09:22:48 +0000 |
commit | c3e2005d4a8bc51460a8ad9661c8961ad8c6eaf4 (patch) | |
tree | 675b6f2f85da8e06f7468074de67a18557fd0264 /platform-logic/generic-resource-api/src/main/xml | |
parent | 2f22550c87f010ff008012900f14211b5c41a0bc (diff) | |
parent | a24afe5397444a817bea065d6e6a9d29ad95b54e (diff) |
Merge "Add DGs for vCPE use case"
Former-commit-id: 5d890ae8e13a5a077470ca3cd86055d8a4a87c82
Diffstat (limited to 'platform-logic/generic-resource-api/src/main/xml')
16 files changed, 1972 insertions, 0 deletions
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_brg-topology-operation-activate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_brg-topology-operation-activate.xml new file mode 100644 index 00000000..163e69b2 --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_brg-topology-operation-activate.xml @@ -0,0 +1,118 @@ +<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='brg-topology-operation-activate' mode='sync'>
+<block atomic="true"><set>
+<parameter name='tmp.ar.allotted-resource-id' value='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+<parameter name='tmp.ar.parent-service-instance-id' value='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+<parameter name='tmp.ar.sz-vnf-id' value='`$brg-topology-operation-input.allotted-resource-data.brg-topology.brg-assignments.brg-vnf-id`' />
+
+
+</set><set>
+<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:brg-allotted-resources/brg-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/brg-topology/'` " />
+
+</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-sz-ar' value='$mdsal-ar.' />
+</set><switch test='`$mdsal-ar.brg-allotted-resource_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='sz-ar.' value='$mdsal-ar.brg-allotted-resource[0].' />
+</set><switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+<outcome value='Created'>
+<block>
+</block></outcome><outcome value='Other'>
+<block>
+</block></outcome></switch><set>
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><set>
+<parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='sz-ar.allotted-resource-status.action' value="`$brg-topology-operation-input.request-information.request-action` " />
+<parameter name='sz-ar.allotted-resource-status.rpc-name' value="brg-topology-operation" />
+<parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$brg-topology-operation-input.sdnc-request-header.svc-action` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$brg-topology-operation-input.request-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$brg-topology-operation-input.sdnc-request-header.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$brg-topology-operation-input.service-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$brg-topology-operation-input.allotted-resource-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.brg-request-input.' value="`$brg-topology-operation-input.brg-request-input.` " /></set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+
+</execute><set>
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Active' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-topology-operation-input.request-information.request-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-topology-operation-input.sdnc-request-header.svc-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-topology-operation-input.sdnc-request-header.svc-request-id`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+</set><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="operational-status" value="in-service-path" />
+<outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+</return></outcome><outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+</return></outcome></update><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for brg-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 brg-allotted-resource" />
+</return></outcome></execute><set>
+<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+<parameter name='brg-object-path' value="`$tmp.ar.self-link`"/>
+<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $brg-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+
+</set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic>
\ No newline at end of file diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_brg-topology-operation-assign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_brg-topology-operation-assign.xml new file mode 100644 index 00000000..1d08a1c1 --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_brg-topology-operation-assign.xml @@ -0,0 +1,281 @@ +<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='brg-topology-operation-assign' mode='sync'>
+<block atomic="true"><set>
+<parameter name='tmp.ar.allotted-resource-id' value='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+<parameter name='tmp.ar.parent-service-instance-id' value='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+<parameter name='tmp.ar.sz-vnf-id' value='`$brg-topology-operation-input.allotted-resource-data.brg-topology.brg-assignments.brg-vnf-id`' />
+
+
+</set><set>
+<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:brg-allotted-resources/brg-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/brg-topology/'` " />
+
+</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vnf-provided-allottedresource`" />
+ <parameter name="outputPath" value="tmp.vnf-p-ar-url" />
+ <parameter name="target" value="{service-instance-id}" />
+ <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`" />
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.vnf-p-ar-url`" />
+ <parameter name="outputPath" value="tmp.vnf-p-ar-url" />
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.sz-vnf-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-sz-ar' value='$mdsal-ar.' />
+</set><switch test='`$mdsal-ar.brg-allotted-resource_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='sz-ar.' value='$mdsal-ar.brg-allotted-resource[0].' />
+</set><switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+<outcome value='Created'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Existing brg-allotted-resource with order status of ' + $sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`" />
+</return></outcome><outcome value='PendingDelete'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Existing brg-allotted-resource with order status of ' + $sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`" />
+</return></outcome></switch><set>
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><set>
+<parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='sz-ar.allotted-resource-status.action' value="`$brg-topology-operation-input.request-information.request-action` " />
+<parameter name='sz-ar.allotted-resource-status.rpc-name' value="brg-topology-operation" />
+<parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$brg-topology-operation-input.sdnc-request-header.svc-action` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$brg-topology-operation-input.request-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$brg-topology-operation-input.sdnc-request-header.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$brg-topology-operation-input.service-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$brg-topology-operation-input.allotted-resource-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.brg-request-input.' value="`$brg-topology-operation-input.brg-request-input.` " /></set><set>
+<parameter name='sz-ar-identifiers.consuming-service-instance-id' value="`$brg-topology-operation-input.service-information.service-instance-id` " />
+<parameter name='sz-ar-identifiers.parent-service-instance-id' value="`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id` " />
+<parameter name='sz-ar-identifiers.allotted-resource-type' value="`$brg-topology-operation-input.allotted-resource-information.allotted-resource-type` " />
+<parameter name='sz-ar-identifiers.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+
+</set><set>
+<parameter name='sz-ar.allotted-resource-data.brg-topology.onap-model-information.'
+value="`$brg-topology-operation-input.allotted-resource-information.onap-model-information.`" />
+
+
+</set><switch test='$brg-topology-operation-input.allotted-resource-information.onap-model-information.model-invariant-uuid'>
+<outcome value=''>
+<set>
+<parameter name='sz-ar.allotted-resource-data.brg-topology.onap-model-information.model-invariant-uuid'
+value="`$ar-model.invariant-uuid`" />
+
+
+</set></outcome></switch><switch test='$brg-topology-operation-input.allotted-resource-information.onap-model-information.model-uuid'>
+<outcome value=''>
+<set>
+<parameter name='sz-ar.allotted-resource-data.brg-topology.onap-model-information.model-uuid'
+value="`$ar-model.uuid`" />
+
+
+</set></outcome></switch><switch test='$brg-topology-operation-input.allotted-resource-information.onap-model-information.model-version'>
+<outcome value=''>
+<set>
+<parameter name='sz-ar.allotted-resource-data.brg-topology.onap-model-information.model-version'
+value="`$ar-model.version`" />
+
+
+</set></outcome></switch><switch test='`$ar-model.ecomp-generated-naming`'>
+<outcome value='Y'>
+<block atomic="true">
+<switch test='`$ar-model.naming-policy`'>
+<outcome value='oam_security_zone_name'>
+<block atomic='true'>
+<set>
+<parameter name='tmp.ar-name' value='$TenantOAMNetworkRole_$LandingNetworkRole_SZ' />
+</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$TenantOAMNetworkRole"/>
+ <parameter name="replacement" value="`$brg-topology-operation-input.brg-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="`$brg-topology-operation-input.brg-request-input.trusted-network-role`"/>
+
+</execute><set>
+<parameter name='sz-ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
+</set></block></outcome><outcome value='Other'>
+<block atomic='true'>
+<set>
+<parameter name='tmp.ar-name' value='$TenantOAMNetworkRole_$LandingNetworkRole_SZ' />
+</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$TenantOAMNetworkRole"/>
+ <parameter name="replacement" value="`$brg-topology-operation-input.brg-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="`$brg-topology-operation-input.brg-request-input.trusted-network-role`"/>
+
+</execute><set>
+<parameter name='sz-ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error in allotted-resource-model data. Ecomp-generated-naming should be true" />
+
+</return></outcome></switch><set>
+<parameter name='sz-ar.allotted-resource-data.brg-topology.allotted-resource-identifiers.'
+value="`$sz-ar-identifiers.`" />
+
+
+</set><set>
+<parameter name='sz-ar-assignments.vlan-tag' value="`$brg-topology-operation-input.brg-request-input.vlan-tag` " />
+<parameter name='sz-ar-assignments.trusted-network-role' value="`$brg-topology-operation-input.brg-request-input.trusted-network-role` " />
+<parameter name='sz-ar-assignments.untrusted-network-role' value="`$brg-topology-operation-input.brg-request-input.untrusted-network-role` " />
+<parameter name='sz-ar-assignments.brg-service-instance-id' value="`$tmp.ar.parent-service-instance-id` " />
+
+</set><call module='GENERIC-RESOURCE-API' rpc='generate-panorama-name' mode='sync' >
+</call><set>
+<parameter name='sz-ar-assignments.brg-name-untrusted' value="`$tmp.untrust-sz` " />
+<parameter name='sz-ar-assignments.brg-name-trusted' value="`$tmp.trust-sz` " />
+
+
+</set><set>
+<parameter name='sz-ar.allotted-resource-data.brg-topology.brg-assignments.'
+value="`$sz-ar-assignments.`" />
+
+
+</set><switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'>
+<outcome value=''>
+<set>
+<parameter name='tmp.cidx' value="`0`" />
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value="1" />
+
+
+</set></outcome><outcome value='Other'>
+<block atomic="true"><for index='cidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' >
+<switch test="`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].allotted-resource-id == $tmp.ar.allotted-resource-id`">
+
+<outcome value='true'>
+<block atomic="true"><set>
+<parameter name='tmp.cidx' value='`$cidx`' />
+<parameter name='ctx.consumed-ar.' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].`' />
+<parameter name='tmp.found-cidx' value='true' /></set><break>
+</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="`$brg-topology-operation-input.allotted-resource-information.allotted-resource-type` " />
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-pointer' value="`$tmp.ar.self-link` " />
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value='`$tmp.cidx + 1`' />
+
+</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+
+</execute><set>
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingCreate' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-topology-operation-input.request-information.request-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-topology-operation-input.sdnc-request-header.svc-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-topology-operation-input.sdnc-request-header.svc-request-id`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+</set><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="description" value="`$brg-topology-operation-input.allotted-resource-information.allotted-resource-type`" />
+ <parameter name="selflink" value="`$tmp.ar.self-link`" />
+ <parameter name="model-invariant-id" value="`$ar-model.invariant-uuid`" />
+ <parameter name="model-version-id" value="`$ar-model.uuid`" />
+ <parameter name="operational-status" value="null" />
+<outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+</return></outcome><outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+</return></outcome></update><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="parent" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<block>
+</block></outcome><outcome value='not-found'>
+<block>
+</block></outcome></execute></block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for brg-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 brg-allotted-resource" />
+</return></outcome></execute><set>
+<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+<parameter name='brg-object-path' value="`$tmp.ar.self-link`"/>
+<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $brg-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+
+</set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic>
\ No newline at end of file diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_brg-topology-operation-create.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_brg-topology-operation-create.xml new file mode 100644 index 00000000..7a2751a0 --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_brg-topology-operation-create.xml @@ -0,0 +1,100 @@ +<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='brg-topology-operation-create' mode='sync'>
+<block atomic="true"><set>
+<parameter name='tmp.ar.allotted-resource-id' value='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+<parameter name='tmp.ar.parent-service-instance-id' value='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+<parameter name='tmp.ar.sz-vnf-id' value='`$brg-topology-operation-input.allotted-resource-data.brg-topology.brg-assignments.brg-vnf-id`' />
+
+
+</set><set>
+<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:brg-allotted-resources/brg-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/brg-topology/'` " />
+
+</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-sz-ar' value='$mdsal-ar.' />
+</set><switch test='`$mdsal-ar.brg-allotted-resource_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='sz-ar.' value='$mdsal-ar.brg-allotted-resource[0].' />
+</set><switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+<outcome value='PendingCreate'>
+<block>
+</block></outcome><outcome value='Other'>
+<block>
+</block></outcome></switch><set>
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><set>
+<parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='sz-ar.allotted-resource-status.action' value="`$brg-topology-operation-input.request-information.request-action` " />
+<parameter name='sz-ar.allotted-resource-status.rpc-name' value="brg-topology-operation" />
+<parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$brg-topology-operation-input.sdnc-request-header.svc-action` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$brg-topology-operation-input.request-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$brg-topology-operation-input.sdnc-request-header.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$brg-topology-operation-input.service-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$brg-topology-operation-input.allotted-resource-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.brg-request-input.' value="`$brg-topology-operation-input.brg-request-input.` " /></set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+
+</execute><set>
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Created' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-topology-operation-input.request-information.request-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-topology-operation-input.sdnc-request-header.svc-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-topology-operation-input.sdnc-request-header.svc-request-id`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+</set><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for brg-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 brg-allotted-resource" />
+</return></outcome></execute><set>
+<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+<parameter name='brg-object-path' value="`$tmp.ar.self-link`"/>
+<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $brg-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+
+</set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic>
\ No newline at end of file diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_brg-topology-operation-deactivate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_brg-topology-operation-deactivate.xml new file mode 100644 index 00000000..8d5eb77f --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_brg-topology-operation-deactivate.xml @@ -0,0 +1,118 @@ +<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='brg-topology-operation-deactivate' mode='sync'>
+<block atomic="true"><set>
+<parameter name='tmp.ar.allotted-resource-id' value='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+<parameter name='tmp.ar.parent-service-instance-id' value='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+<parameter name='tmp.ar.sz-vnf-id' value='`$brg-topology-operation-input.allotted-resource-data.brg-topology.brg-assignments.brg-vnf-id`' />
+
+
+</set><set>
+<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:brg-allotted-resources/brg-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/brg-topology/'` " />
+
+</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-sz-ar' value='$mdsal-ar.' />
+</set><switch test='`$mdsal-ar.brg-allotted-resource_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='sz-ar.' value='$mdsal-ar.brg-allotted-resource[0].' />
+</set><switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+<outcome value='Created'>
+<block>
+</block></outcome><outcome value='Other'>
+<block>
+</block></outcome></switch><set>
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><set>
+<parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='sz-ar.allotted-resource-status.action' value="`$brg-topology-operation-input.request-information.request-action` " />
+<parameter name='sz-ar.allotted-resource-status.rpc-name' value="brg-topology-operation" />
+<parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$brg-topology-operation-input.sdnc-request-header.svc-action` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$brg-topology-operation-input.request-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$brg-topology-operation-input.sdnc-request-header.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$brg-topology-operation-input.service-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$brg-topology-operation-input.allotted-resource-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.brg-request-input.' value="`$brg-topology-operation-input.brg-request-input.` " /></set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+
+</execute><set>
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-topology-operation-input.request-information.request-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-topology-operation-input.sdnc-request-header.svc-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-topology-operation-input.sdnc-request-header.svc-request-id`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+</set><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="operational-status" value="out-of-service-path" />
+<outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+</return></outcome><outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+</return></outcome></update><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for brg-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 brg-allotted-resource" />
+</return></outcome></execute><set>
+<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+<parameter name='brg-object-path' value="`$tmp.ar.self-link`"/>
+<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $brg-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+
+</set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic>
\ No newline at end of file diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_brg-topology-operation-delete.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_brg-topology-operation-delete.xml new file mode 100644 index 00000000..6610dfd7 --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_brg-topology-operation-delete.xml @@ -0,0 +1,105 @@ +<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='brg-topology-operation-delete' mode='sync'>
+<block atomic="true"><set>
+<parameter name='tmp.ar.allotted-resource-id' value='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+<parameter name='tmp.ar.parent-service-instance-id' value='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+<parameter name='tmp.ar.sz-vnf-id' value='`$brg-topology-operation-input.allotted-resource-data.brg-topology.brg-assignments.brg-vnf-id`' />
+
+
+</set><set>
+<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:brg-allotted-resources/brg-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/brg-topology/'` " />
+
+</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-sz-ar' value='$mdsal-ar.' />
+</set><switch test='`$mdsal-ar.brg-allotted-resource_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='sz-ar.' value='$mdsal-ar.brg-allotted-resource[0].' />
+</set><switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+<outcome value='Created'>
+<block>
+</block></outcome><outcome value='Other'>
+<block>
+</block></outcome></switch><set>
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><set>
+<parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='sz-ar.allotted-resource-status.action' value="`$brg-topology-operation-input.request-information.request-action` " />
+<parameter name='sz-ar.allotted-resource-status.rpc-name' value="brg-topology-operation" />
+<parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$brg-topology-operation-input.sdnc-request-header.svc-action` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$brg-topology-operation-input.request-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$brg-topology-operation-input.sdnc-request-header.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$brg-topology-operation-input.service-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$brg-topology-operation-input.allotted-resource-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.brg-request-input.' value="`$brg-topology-operation-input.brg-request-input.` " /></set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+
+</execute><set>
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-topology-operation-input.request-information.request-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-topology-operation-input.sdnc-request-header.svc-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-topology-operation-input.sdnc-request-header.svc-request-id`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+</set><set>
+<parameter name='sz-ar-assignments.' value="" />
+
+
+
+</set><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for brg-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 brg-allotted-resource" />
+</return></outcome></execute><set>
+<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+<parameter name='brg-object-path' value="`$tmp.ar.self-link`"/>
+<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $brg-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+
+</set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic>
\ No newline at end of file diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_brg-topology-operation-unassign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_brg-topology-operation-unassign.xml new file mode 100644 index 00000000..52dbdc33 --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_brg-topology-operation-unassign.xml @@ -0,0 +1,81 @@ +<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='brg-topology-operation-unassign' mode='sync'>
+<block atomic="true"><set>
+<parameter name='tmp.ar.allotted-resource-id' value='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+<parameter name='tmp.ar.parent-service-instance-id' value='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+<parameter name='tmp.ar.sz-vnf-id' value='`$brg-topology-operation-input.allotted-resource-data.brg-topology.brg-assignments.brg-vnf-id`' />
+
+
+</set><set>
+<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:brg-allotted-resources/brg-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/brg-topology/'` " />
+
+</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.sz-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-sz-ar' value='$mdsal-ar.' />
+</set><switch test='`$mdsal-ar.brg-allotted-resource_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='sz-ar.' value='$mdsal-ar.brg-allotted-resource[0].' />
+</set><switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+<outcome value='Created'>
+<block>
+</block></outcome><outcome value='Other'>
+<block>
+</block></outcome></switch><set>
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for brg-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 brg-allotted-resource" />
+</return></outcome></execute><set>
+<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+<parameter name='brg-object-path' value="`$tmp.ar.self-link`"/>
+<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $brg-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+
+</set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic>
\ No newline at end of file diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_brg-topology-operation.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_brg-topology-operation.xml new file mode 100644 index 00000000..2434d1ab --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_brg-topology-operation.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='${project.version}'><method rpc='brg-topology-operation' mode='sync'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='validate-brg-input' mode='sync' >
+</call><switch test='`$brg-topology-operation-input.sdnc-request-header.svc-action`'>
+<outcome value='assign'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='brg-topology-operation-assign' mode='sync' >
+</call></block></outcome><outcome value='create'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='brg-topology-operation-create' mode='sync' >
+</call></block></outcome><outcome value='activate'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='brg-topology-operation-activate' mode='sync' >
+</call></block></outcome><outcome value='deactivate'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='brg-topology-operation-deactivate' mode='sync' >
+</call></block></outcome><outcome value='delete'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='brg-topology-operation-delete' mode='sync' >
+</call></block></outcome><outcome value='unassign'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='brg-topology-operation-unassign' mode='sync' >
+</call></block></outcome><outcome value='Other'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+</return></outcome></switch><set>
+<parameter name="ack-final" value="Y"/></set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic>
\ No newline at end of file diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-activate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-activate.xml new file mode 100644 index 00000000..00d3df3e --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-activate.xml @@ -0,0 +1,118 @@ +<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-activate' 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`' />
+<parameter name='tmp.ar.sz-vnf-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.tunnelxconn-vnf-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.sz-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-sz-ar' value='$mdsal-ar.' />
+</set><switch test='`$mdsal-ar.tunnelxconn-allotted-resource_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='sz-ar.' value='$mdsal-ar.tunnelxconn-allotted-resource[0].' />
+</set><switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+<outcome value='Created'>
+<block>
+</block></outcome><outcome value='Other'>
+<block>
+</block></outcome></switch><set>
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><set>
+<parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='sz-ar.allotted-resource-status.action' value="`$tunnelxconn-topology-operation-input.request-information.request-action` " />
+<parameter name='sz-ar.allotted-resource-status.rpc-name' value="tunnelxconn-topology-operation" />
+<parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$tunnelxconn-topology-operation-input.request-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$tunnelxconn-topology-operation-input.service-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.' value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.` " /></set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+
+</execute><set>
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Active' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tunnelxconn-topology-operation-input.request-information.request-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action`' />
+<parameter name='sz-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='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+</set><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="operational-status" value="in-service-path" />
+<outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+</return></outcome><outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+</return></outcome></update><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for 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></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 new file mode 100644 index 00000000..e318c7cd --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-assign.xml @@ -0,0 +1,281 @@ +<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`' />
+<parameter name='tmp.ar.sz-vnf-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.tunnelxconn-vnf-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.sz-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.vnf-provided-allottedresource`" />
+ <parameter name="outputPath" value="tmp.vnf-p-ar-url" />
+ <parameter name="target" value="{service-instance-id}" />
+ <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`" />
+</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.vnf-p-ar-url`" />
+ <parameter name="outputPath" value="tmp.vnf-p-ar-url" />
+ <parameter name="target" value="{vnf-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.sz-vnf-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-sz-ar' value='$mdsal-ar.' />
+</set><switch test='`$mdsal-ar.tunnelxconn-allotted-resource_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='sz-ar.' value='$mdsal-ar.tunnelxconn-allotted-resource[0].' />
+</set><switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+<outcome value='Created'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Existing tunnelxconn-allotted-resource with order status of ' + $sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`" />
+</return></outcome><outcome value='PendingDelete'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message"
+ value="`'Existing tunnelxconn-allotted-resource with order status of ' + $sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`" />
+</return></outcome></switch><set>
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><set>
+<parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='sz-ar.allotted-resource-status.action' value="`$tunnelxconn-topology-operation-input.request-information.request-action` " />
+<parameter name='sz-ar.allotted-resource-status.rpc-name' value="tunnelxconn-topology-operation" />
+<parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$tunnelxconn-topology-operation-input.request-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$tunnelxconn-topology-operation-input.service-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.' value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.` " /></set><set>
+<parameter name='sz-ar-identifiers.consuming-service-instance-id' value="`$tunnelxconn-topology-operation-input.service-information.service-instance-id` " />
+<parameter name='sz-ar-identifiers.parent-service-instance-id' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id` " />
+<parameter name='sz-ar-identifiers.allotted-resource-type' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-type` " />
+<parameter name='sz-ar-identifiers.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+
+</set><set>
+<parameter name='sz-ar.allotted-resource-data.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='sz-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='sz-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='sz-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_security_zone_name'>
+<block atomic='true'>
+<set>
+<parameter name='tmp.ar-name' value='$TenantOAMNetworkRole_$LandingNetworkRole_SZ' />
+</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$TenantOAMNetworkRole"/>
+ <parameter name="replacement" value="`$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='sz-ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
+</set></block></outcome><outcome value='Other'>
+<block atomic='true'>
+<set>
+<parameter name='tmp.ar-name' value='$TenantOAMNetworkRole_$LandingNetworkRole_SZ' />
+</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.ar-name`"/>
+ <parameter name="outputPath" value="tmp.ar-name"/>
+ <parameter name="target" value="$TenantOAMNetworkRole"/>
+ <parameter name="replacement" value="`$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='sz-ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error in allotted-resource-model data. Ecomp-generated-naming should be true" />
+
+</return></outcome></switch><set>
+<parameter name='sz-ar.allotted-resource-data.tunnelxconn-topology.allotted-resource-identifiers.'
+value="`$sz-ar-identifiers.`" />
+
+
+</set><set>
+<parameter name='sz-ar-assignments.vlan-tag' value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.vlan-tag` " />
+<parameter name='sz-ar-assignments.trusted-network-role' value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.trusted-network-role` " />
+<parameter name='sz-ar-assignments.untrusted-network-role' value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.untrusted-network-role` " />
+<parameter name='sz-ar-assignments.tunnelxconn-service-instance-id' value="`$tmp.ar.parent-service-instance-id` " />
+
+</set><call module='GENERIC-RESOURCE-API' rpc='generate-panorama-name' mode='sync' >
+</call><set>
+<parameter name='sz-ar-assignments.tunnelxconn-name-untrusted' value="`$tmp.untrust-sz` " />
+<parameter name='sz-ar-assignments.tunnelxconn-name-trusted' value="`$tmp.trust-sz` " />
+
+
+</set><set>
+<parameter name='sz-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.'
+value="`$sz-ar-assignments.`" />
+
+
+</set><switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'>
+<outcome value=''>
+<set>
+<parameter name='tmp.cidx' value="`0`" />
+<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value="1" />
+
+
+</set></outcome><outcome value='Other'>
+<block atomic="true"><for index='cidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' >
+<switch test="`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].allotted-resource-id == $tmp.ar.allotted-resource-id`">
+
+<outcome value='true'>
+<block atomic="true"><set>
+<parameter name='tmp.cidx' value='`$cidx`' />
+<parameter name='ctx.consumed-ar.' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].`' />
+<parameter name='tmp.found-cidx' value='true' /></set><break>
+</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='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingCreate' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tunnelxconn-topology-operation-input.request-information.request-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action`' />
+<parameter name='sz-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='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+</set><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="description" value="`$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.sz.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="parent" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<block>
+</block></outcome><outcome value='not-found'>
+<block>
+</block></outcome></execute></block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for 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></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-create.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-create.xml new file mode 100644 index 00000000..1fa67910 --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-create.xml @@ -0,0 +1,100 @@ +<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='tunnelxconn-topology-operation-create' 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`' />
+<parameter name='tmp.ar.sz-vnf-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.tunnelxconn-vnf-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.sz-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-sz-ar' value='$mdsal-ar.' />
+</set><switch test='`$mdsal-ar.tunnelxconn-allotted-resource_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='sz-ar.' value='$mdsal-ar.tunnelxconn-allotted-resource[0].' />
+</set><switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+<outcome value='PendingCreate'>
+<block>
+</block></outcome><outcome value='Other'>
+<block>
+</block></outcome></switch><set>
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><set>
+<parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='sz-ar.allotted-resource-status.action' value="`$tunnelxconn-topology-operation-input.request-information.request-action` " />
+<parameter name='sz-ar.allotted-resource-status.rpc-name' value="tunnelxconn-topology-operation" />
+<parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$tunnelxconn-topology-operation-input.request-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$tunnelxconn-topology-operation-input.service-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.' value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.` " /></set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+
+</execute><set>
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Created' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tunnelxconn-topology-operation-input.request-information.request-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action`' />
+<parameter name='sz-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='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+</set><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for 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></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-deactivate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-deactivate.xml new file mode 100644 index 00000000..1cc0951d --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-deactivate.xml @@ -0,0 +1,118 @@ +<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-deactivate' 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`' />
+<parameter name='tmp.ar.sz-vnf-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.tunnelxconn-vnf-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.sz-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-sz-ar' value='$mdsal-ar.' />
+</set><switch test='`$mdsal-ar.tunnelxconn-allotted-resource_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='sz-ar.' value='$mdsal-ar.tunnelxconn-allotted-resource[0].' />
+</set><switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+<outcome value='Created'>
+<block>
+</block></outcome><outcome value='Other'>
+<block>
+</block></outcome></switch><set>
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><set>
+<parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='sz-ar.allotted-resource-status.action' value="`$tunnelxconn-topology-operation-input.request-information.request-action` " />
+<parameter name='sz-ar.allotted-resource-status.rpc-name' value="tunnelxconn-topology-operation" />
+<parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$tunnelxconn-topology-operation-input.request-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$tunnelxconn-topology-operation-input.service-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.' value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.` " /></set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+
+</execute><set>
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tunnelxconn-topology-operation-input.request-information.request-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action`' />
+<parameter name='sz-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='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+</set><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $service-data.service-information.global-customer-id AND
+ service-subscription.service-type = $service-data.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $service-data.service-information.service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="operational-status" value="out-of-service-path" />
+<outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+</return></outcome><outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+</return></outcome></update><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for 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></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-delete.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-delete.xml new file mode 100644 index 00000000..8339f562 --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-delete.xml @@ -0,0 +1,105 @@ +<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='tunnelxconn-topology-operation-delete' 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`' />
+<parameter name='tmp.ar.sz-vnf-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.tunnelxconn-vnf-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.sz-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-sz-ar' value='$mdsal-ar.' />
+</set><switch test='`$mdsal-ar.tunnelxconn-allotted-resource_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='sz-ar.' value='$mdsal-ar.tunnelxconn-allotted-resource[0].' />
+</set><switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+<outcome value='Created'>
+<block>
+</block></outcome><outcome value='Other'>
+<block>
+</block></outcome></switch><set>
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><set>
+<parameter name='sz-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+<parameter name='sz-ar.allotted-resource-status.action' value="`$tunnelxconn-topology-operation-input.request-information.request-action` " />
+<parameter name='sz-ar.allotted-resource-status.rpc-name' value="tunnelxconn-topology-operation" />
+<parameter name='sz-ar.allotted-resource-status.rpc-action' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$tunnelxconn-topology-operation-input.request-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$tunnelxconn-topology-operation-input.sdnc-request-header.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$tunnelxconn-topology-operation-input.service-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$tunnelxconn-topology-operation-input.allotted-resource-information.` " />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.' value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.` " /></set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+
+</execute><set>
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$tunnelxconn-topology-operation-input.request-information.request-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action`' />
+<parameter name='sz-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='sz-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+</set><set>
+<parameter name='sz-ar-assignments.' value="" />
+
+
+
+</set><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sz.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for 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></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-unassign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-unassign.xml new file mode 100644 index 00000000..fe52810c --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-unassign.xml @@ -0,0 +1,81 @@ +<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='tunnelxconn-topology-operation-unassign' 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`' />
+<parameter name='tmp.ar.sz-vnf-id' value='`$tunnelxconn-topology-operation-input.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.tunnelxconn-vnf-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.sz-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+</execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block atomic="true">
+<set>
+<parameter name='bk-sz-ar' value='$mdsal-ar.' />
+</set><switch test='`$mdsal-ar.tunnelxconn-allotted-resource_length`'>
+<outcome value='1'>
+<block atomic='true'>
+<set>
+<parameter name='sz-ar.' value='$mdsal-ar.tunnelxconn-allotted-resource[0].' />
+</set><switch test='`$sz-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+<outcome value='Created'>
+<block>
+</block></outcome><outcome value='Other'>
+<block>
+</block></outcome></switch><set>
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$sz-ar.allotted-resource-status.rpc-action`' />
+<parameter name='sz-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$sz-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+
+</set></block></outcome></switch></block></outcome><outcome value='Other'>
+<block atomic="true">
+</block></outcome></execute><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='DELETE' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+
+<outcome value='success'>
+<block>
+</block></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for 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></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.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_tunnelxconn-topology-operation.xml new file mode 100644 index 00000000..0ea81c87 --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_tunnelxconn-topology-operation.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='${project.version}'><method rpc='tunnelxconn-topology-operation' mode='sync'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='validate-tunnelxconn-input' mode='sync' >
+</call><switch test='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action`'>
+<outcome value='assign'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='tunnelxconn-topology-operation-assign' mode='sync' >
+</call></block></outcome><outcome value='create'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='tunnelxconn-topology-operation-create' mode='sync' >
+</call></block></outcome><outcome value='activate'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='tunnelxconn-topology-operation-activate' mode='sync' >
+</call></block></outcome><outcome value='deactivate'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='tunnelxconn-topology-operation-deactivate' mode='sync' >
+</call></block></outcome><outcome value='delete'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='tunnelxconn-topology-operation-delete' mode='sync' >
+</call></block></outcome><outcome value='unassign'>
+<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='tunnelxconn-topology-operation-unassign' mode='sync' >
+</call></block></outcome><outcome value='Other'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+</return></outcome></switch><set>
+<parameter name="ack-final" value="Y"/></set><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic>
\ No newline at end of file diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-brg-input.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-brg-input.xml new file mode 100644 index 00000000..131405ed --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-brg-input.xml @@ -0,0 +1,157 @@ +<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='validate-brg-input' mode='sync'>
+<block atomic="true"><switch test='`$brg-topology-operation-input.sdnc-request-header.svc-action`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.sdnc-request-header.svc-request-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.request-information.request-action`'>
+<outcome value='CreateSecurityZoneInstance'><block>
+</block></outcome><outcome value='DeleteSecurityZoneInstance'><block>
+</block></outcome><outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required input" />
+</return></outcome><outcome value='Other'><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Invalid request-information.request-action " />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.service-information.service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.service-instance-id is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.sdnc-request-header.svc-action`'>
+<outcome value='assign'><block atomic="true"><switch test='`$brg-topology-operation-input.request-information.request-action`'>
+<outcome value='CreateSecurityZoneInstance'><block atomic="true"><switch test='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-type`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-type is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="brg-information.onap-model-information.model-customization-uuid is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.brg-request-input.vlan-tag`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="brg-topology-operation-input.brg-request-input.vlan-tag is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.brg-request-input.trusted-network-role`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="brg-topology-operation-input.brg-request-input.trusted-network-role is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.brg-request-input.untrusted-network-role`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="brg-operation-input.brg-request-input.untrusted-network-role is a required input" />
+</return></outcome></switch><get-resource plugin='org.onap.ccsdk.sli.adaptors.sli.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from ALLOTTED_RESOURCE_MODEL WHERE customization_uuid = $brg-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid'
+ pfx='ar-model'>
+
+<outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No alloted resource model found for model customization UUID ' + $brg-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" />
+</return></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No alloted resource model found for model customization UUID ' + $brg-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" />
+</return></outcome></get-resource></block></outcome><outcome value='Other'><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required to be CreateSecurityZoneInstance for svc-action=assign" />
+</return></outcome></switch></block></outcome><outcome value='create'><block atomic="true"><switch test='`$brg-topology-operation-input.request-information.request-action`'>
+<outcome value='CreateSecurityZoneInstance'><block atomic="true"><switch test='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch></block></outcome><outcome value='Other'><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required to be CreateSecurityZoneInstance for svc-action=create" />
+</return></outcome></switch></block></outcome><outcome value='activate'><block atomic="true"><switch test='`$brg-topology-operation-input.request-information.request-action`'>
+<outcome value='CreateSecurityZoneInstance'><block atomic="true"><switch test='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch></block></outcome><outcome value='Other'><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required to be CreateSecurityZoneInstance for svc-action=activate" />
+</return></outcome></switch></block></outcome><outcome value='deactivate'><block atomic="true"><switch test='`$brg-topology-operation-input.request-information.request-action`'>
+<outcome value='DeleteSecurityZoneInstance'><block atomic="true"><switch test='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch></block></outcome><outcome value='Other'><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required to be DeleteSecurityZoneInstance for svc-action=deactivate" />
+</return></outcome></switch></block></outcome><outcome value='delete'><block atomic="true"><switch test='`$brg-topology-operation-input.request-information.request-action`'>
+<outcome value='DeleteSecurityZoneInstance'><block atomic="true"><switch test='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch></block></outcome><outcome value='Other'><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required to be DeleteSecurityZoneInstance for svc-action=delete" />
+</return></outcome></switch></block></outcome><outcome value='unassign'><block atomic="true"><switch test='`$brg-topology-operation-input.request-information.request-action`'>
+<outcome value='DeleteSecurityZoneInstance'><block atomic="true"><switch test='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch></block></outcome><outcome value='Other'><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required to be DeleteSecurityZoneInstance for svc-action=unassign" />
+</return></outcome></switch></block></outcome></switch><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic>
\ No newline at end of file diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-tunnelxconn-input.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-tunnelxconn-input.xml new file mode 100644 index 00000000..d03d75df --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-tunnelxconn-input.xml @@ -0,0 +1,157 @@ +<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'><method rpc='validate-tunnelxconn-input' mode='sync'>
+<block atomic="true"><switch test='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-request-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.request-information.request-action`'>
+<outcome value='CreateSecurityZoneInstance'><block>
+</block></outcome><outcome value='DeleteSecurityZoneInstance'><block>
+</block></outcome><outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required input" />
+</return></outcome><outcome value='Other'><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Invalid request-information.request-action " />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.service-information.service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.service-instance-id is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.sdnc-request-header.svc-action`'>
+<outcome value='assign'><block atomic="true"><switch test='`$tunnelxconn-topology-operation-input.request-information.request-action`'>
+<outcome value='CreateSecurityZoneInstance'><block atomic="true"><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-type`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-type is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="tunnelxconn-information.onap-model-information.model-customization-uuid is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.vlan-tag`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="tunnelxconn-topology-operation-input.tunnelxconn-request-input.vlan-tag is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.trusted-network-role`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="tunnelxconn-topology-operation-input.tunnelxconn-request-input.trusted-network-role is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.untrusted-network-role`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="tunnelxconn-operation-input.tunnelxconn-request-input.untrusted-network-role is a required input" />
+</return></outcome></switch><get-resource plugin='org.onap.ccsdk.sli.adaptors.sli.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'>
+
+<outcome value='not-found'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No alloted resource model found for model customization UUID ' + $tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" />
+</return></outcome><outcome value='failure'>
+<return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No alloted resource model found for model customization UUID ' + $tunnelxconn-topology-operation-input.allotted-resource-information.onap-model-information.model-customization-uuid`" />
+</return></outcome></get-resource></block></outcome><outcome value='Other'><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required to be CreateSecurityZoneInstance for svc-action=assign" />
+</return></outcome></switch></block></outcome><outcome value='create'><block atomic="true"><switch test='`$tunnelxconn-topology-operation-input.request-information.request-action`'>
+<outcome value='CreateSecurityZoneInstance'><block atomic="true"><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch></block></outcome><outcome value='Other'><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required to be CreateSecurityZoneInstance for svc-action=create" />
+</return></outcome></switch></block></outcome><outcome value='activate'><block atomic="true"><switch test='`$tunnelxconn-topology-operation-input.request-information.request-action`'>
+<outcome value='CreateSecurityZoneInstance'><block atomic="true"><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch></block></outcome><outcome value='Other'><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required to be CreateSecurityZoneInstance for svc-action=activate" />
+</return></outcome></switch></block></outcome><outcome value='deactivate'><block atomic="true"><switch test='`$tunnelxconn-topology-operation-input.request-information.request-action`'>
+<outcome value='DeleteSecurityZoneInstance'><block atomic="true"><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch></block></outcome><outcome value='Other'><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required to be DeleteSecurityZoneInstance for svc-action=deactivate" />
+</return></outcome></switch></block></outcome><outcome value='delete'><block atomic="true"><switch test='`$tunnelxconn-topology-operation-input.request-information.request-action`'>
+<outcome value='DeleteSecurityZoneInstance'><block atomic="true"><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.parent-service-instance-id is a required input" />
+</return></outcome></switch></block></outcome><outcome value='Other'><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required to be DeleteSecurityZoneInstance for svc-action=delete" />
+</return></outcome></switch></block></outcome><outcome value='unassign'><block atomic="true"><switch test='`$tunnelxconn-topology-operation-input.request-information.request-action`'>
+<outcome value='DeleteSecurityZoneInstance'><block atomic="true"><switch test='`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+<outcome value=''><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="allotted-resource-information.allotted-resource-id is a required input" />
+</return></outcome></switch></block></outcome><outcome value='Other'><return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is a required to be DeleteSecurityZoneInstance for svc-action=unassign" />
+</return></outcome></switch></block></outcome></switch><return status='success'>
+<parameter name="ack-final-indicator" value="Y" />
+<parameter name="error-code" value="200" />
+<parameter name="error-message" value="`$error-message`" />
+</return></block></method></service-logic>
\ No newline at end of file |