aboutsummaryrefslogtreecommitdiffstats
path: root/platform-logic/optical-service/src/main/xml
diff options
context:
space:
mode:
authorMehreen Kaleem <mehreen.kaleem@us.fujitsu.com>2020-06-30 16:22:34 +0000
committerMehreen Kaleem <mehreen.kaleem@us.fujitsu.com>2020-07-02 06:06:28 +0000
commitd11a3e9608178a9b2ccc8249a3263c571783f69d (patch)
treef1725c0a3c42f3dbc1684af9c7b62cc5f51cc2f4 /platform-logic/optical-service/src/main/xml
parent279a547642166a05a8f1ca246a785ba978096558 (diff)
DG changes for the closed loop and async
support in MDONS Change-Id: Ibb16b84cd37d8d41dd0f511fea81ec329a0f8021 Issue-ID: SDNC-1233 Signed-off-by: Mehreen Kaleem <mehreen.kaleem@us.fujitsu.com> Former-commit-id: 225e1b887423a6a5972cf90216156eebc727a41d
Diffstat (limited to 'platform-logic/optical-service/src/main/xml')
-rw-r--r--platform-logic/optical-service/src/main/xml/optical-service_aai-delete-service-handling.xml48
-rw-r--r--platform-logic/optical-service/src/main/xml/optical-service_create-service-async.xml30
-rw-r--r--platform-logic/optical-service/src/main/xml/optical-service_create-service-relationship.xml20
-rw-r--r--platform-logic/optical-service/src/main/xml/optical-service_inter-domain-handling.xml330
-rw-r--r--platform-logic/optical-service/src/main/xml/optical-service_mdons-closed-loop.xml237
-rw-r--r--platform-logic/optical-service/src/main/xml/optical-service_optical-service-create-sync-success.xml4
-rw-r--r--platform-logic/optical-service/src/main/xml/optical-service_optical-service-create.xml69
-rw-r--r--platform-logic/optical-service/src/main/xml/optical-service_optical-service-delete.xml234
-rw-r--r--platform-logic/optical-service/src/main/xml/optical-service_service-delete-tapi.xml1
9 files changed, 602 insertions, 371 deletions
diff --git a/platform-logic/optical-service/src/main/xml/optical-service_aai-delete-service-handling.xml b/platform-logic/optical-service/src/main/xml/optical-service_aai-delete-service-handling.xml
index c817cee6..b8df0f60 100644
--- a/platform-logic/optical-service/src/main/xml/optical-service_aai-delete-service-handling.xml
+++ b/platform-logic/optical-service/src/main/xml/optical-service_aai-delete-service-handling.xml
@@ -21,40 +21,44 @@ pfx='aai.service' local-only='false'></get-resource>
<parameter name="field2" value="`$aai.service.orchestration-status`"/>
<parameter name="field3" value="`$aai.service.relationship-list.relationship_length`"/>
</record>
- <for index='idx' start='1' end='`$aai.service.relationship-list.relationship_length`' >
- <block atomic='true'>
- <set>
- <parameter name='pnf-name' value='`$aai.service.relationship-list.relationship[$idx].relationship-data[0].relationship-value`' />
- <parameter name='pinterface-name' value='`$aai.service.relationship-list.relationship[$idx].relationship-data[1].relationship-value`' />
- </set>
- <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
- <parameter name="file" value="/opt/opendaylight/current/data/log/async-notif.log" />
- <parameter name="level" value="info" />
- <parameter name="field1" value="Inside Revert PInterface details"/>
- <parameter name="field2" value="`$pnf-name`"/>
- <parameter name="field3" value="`$pinterface-name`"/>
- </record>
- <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ <for index='idx' start='0' end='`$aai.service.relationship-list.relationship_length`' >
+ <switch test="`$aai.service.relationship-list.relationship[$idx].related-to == 'p-interface'`">
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='pnf-name' value='`$aai.service.relationship-list.relationship[$idx].relationship-data[0].relationship-value`' />
+ <parameter name='pinterface-name' value='`$aai.service.relationship-list.relationship[$idx].relationship-data[1].relationship-value`' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/async-notif.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Inside Revert PInterface details"/>
+ <parameter name="field2" value="`$pnf-name`"/>
+ <parameter name="field3" value="`$pinterface-name`"/>
+ </record>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="p-interface"
key='pnf.pnf-name = $pnf-name AND
p-interface.interface-name = $pinterface-name '
pfx='p.in.details' local-only='false'></get-resource>
- <set>
- <parameter name='new-rate' value='`$p.in.details.speed-value`' />
- </set>
- <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+ <set>
+ <parameter name='new-rate' value='`$p.in.details.speed-value`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
force='true'
resource='p-interface'
key='pnf.pnf-name = $pnf-name AND
p-interface.interface-name = $pinterface-name '
local-only='false'>
- <parameter name='available-capacity' value='`$new-rate`' />
- </update>
- <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ <parameter name='available-capacity' value='`$new-rate`' />
+ </update>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key='UPDATE TOPOLOGY_LOGICAL_RELATION_TO_PINTERFACE SET rate = $new-rate WHERE interface_name = $pinterface-name '
force='true' pfx='save-result'></save>
- </block>
+ </block>
+ </outcome>
+ </switch>
</for>
<delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="service-instance"
diff --git a/platform-logic/optical-service/src/main/xml/optical-service_create-service-async.xml b/platform-logic/optical-service/src/main/xml/optical-service_create-service-async.xml
index db55f387..cdb04afb 100644
--- a/platform-logic/optical-service/src/main/xml/optical-service_create-service-async.xml
+++ b/platform-logic/optical-service/src/main/xml/optical-service_create-service-async.xml
@@ -27,10 +27,18 @@ resource='service-instance'
resource='SQL'
key='UPDATE REQUEST_DETAILS SET status = "CREATED" WHERE request_id = $request-id'
force='true' pfx='save-result'></save>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+key="SELECT * from REQUEST_DETAILS WHERE domain_requests = $request-id "
+pfx='access'></get-resource>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+resource='SQL'
+key='UPDATE REQUEST_DETAILS SET status = "CREATED" WHERE request_id = $access.request-id'
+force='true' pfx='save-result'></save>
<record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
<parameter name="file" value="/opt/opendaylight/current/data/log/async-notif.log" />
<parameter name="level" value="info" />
<parameter name="field1" value="Finished updating service in AAI and DB to CREATED"/>
+ <parameter name="field2" value="`$access.request-id`"/>
</record>
</block>
</outcome>
@@ -43,10 +51,26 @@ force='true' pfx='save-result'></save>
</block>
</outcome>
</switch>
+ <set>
+ <parameter name='so.service-instance-id' value='`$access.service-instance-id`' />
+ <parameter name='so.service-type' value='`$access.service-type`' />
+ <parameter name='so.svc-request-id' value='`$access.request-id`' />
+ <parameter name='so.response-code' value='`$response-code`' />
+ <parameter name='so.response-message' value='`$response-message`' />
+ <parameter name='so.ack-final-indicator' value='Y' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/async-notif.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="SO Parameters"/>
+ <parameter name="field2" value="`$so.service-instance-id`"/>
+ <parameter name="field3" value="`$so.svc-request-id`"/>
+ <parameter name="field4" value="`$so.response-code`"/>
+ </record>
<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/' + $prop.restapi.template.so.response.filename`" />
- <parameter name="restapiUrl" value="`$output.notification-url`"/>
- <parameter name="restapiUser" value="`$prop.so.username`" />
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/async-response-so.json'`" />
+ <parameter name="restapiUrl" value="http://so-bpmn-infra.onap:8081/mso/async/services/updateStatus"/>
+ <parameter name="restapiUser" value="sdncaBpmn" />
<parameter name="restapiPassword" value="`$prop.so.password`"/>
<parameter name="httpMethod" value="POST"/>
<parameter name="responsePrefix" value="so-response"/>
diff --git a/platform-logic/optical-service/src/main/xml/optical-service_create-service-relationship.xml b/platform-logic/optical-service/src/main/xml/optical-service_create-service-relationship.xml
index 669f3800..9e4a8759 100644
--- a/platform-logic/optical-service/src/main/xml/optical-service_create-service-relationship.xml
+++ b/platform-logic/optical-service/src/main/xml/optical-service_create-service-relationship.xml
@@ -6,7 +6,7 @@
<get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key='SELECT *
from REQUEST_DETAILS
-WHERE request_id = $as-request-id'
+WHERE request_id = $access-request-id'
pfx='access-service'></get-resource>
<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
<parameter name="original_string" value='`$access-service.domain-requests`'/>
@@ -33,17 +33,19 @@ pfx='ds-details'></get-resource>
</block>
</block>
</for>
- <switch test='`$domain-services_length`'>
- <outcome value='2'>
- <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='service-instance:relationship-list'
+ <switch test='`$domain-services_length == 1`'>
+ <outcome value='false'>
+ <for index='idml' start='0' end='`$oof-response.solutions.routeInfo.linkList_length`' >
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='service-instance:relationship-list'
key='customer.global-customer-id = $optical-service-create-input.global-customer-id AND
service-subscription.service-type = $optical-service-create-input.service-type AND
service-instance.service-instance-id = $access-service.service-instance-id' force="true" pfx="tmp.AnAI-data">
- <parameter name="relationship-list.relationship[0].related-to" value="service-instance" />
- <parameter name="relationship-list.relationship[0].related-link" value="`'/network/logical-links/logical-link/' + $inter.logical-link[$ida].link-name`" />
- <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="logical-link.link-name" />
- <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$inter.logical-link[$ida].link-name`" />
- </save>
+ <parameter name="relationship-list.relationship[0].related-to" value="service-instance" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`'/network/logical-links/logical-link/' + $oof-response.solutions.routeInfo.linkList[$idml]`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="logical-link.link-name" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$oof-response.solutions.routeInfo.linkList[$idml]`" />
+ </save>
+ </for>
</outcome>
</switch>
</block>
diff --git a/platform-logic/optical-service/src/main/xml/optical-service_inter-domain-handling.xml b/platform-logic/optical-service/src/main/xml/optical-service_inter-domain-handling.xml
index 4e712ea0..7f67e5de 100644
--- a/platform-logic/optical-service/src/main/xml/optical-service_inter-domain-handling.xml
+++ b/platform-logic/optical-service/src/main/xml/optical-service_inter-domain-handling.xml
@@ -3,195 +3,197 @@
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='optical-service' version='${project.version}'>
<method rpc='inter-domain-handling' mode='sync'>
<block atomic="true">
- <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
-resource="logical-links"
-key=" "
-pfx='inter' local-only='false' >
- <outcome value='not-found'>
- <return status='failure'>
- <parameter name='error-code' value='500' />
- <parameter name='error-message' value='No inter-domain-links available' />
- <parameter name='ack-final-indicator' value="Y" />
- </return>
+ <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
+ <parameter name='fileName' value='/opt/onap/sdnc/data/properties/optical-service-dg.properties' />
+ <parameter name='contextPrefix' value='prop' />
+ </execute>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+key='SELECT * from TOPOLOGY_LOGICAL_RELATION_TO_PINTERFACE WHERE interface_name = $src-port-id'
+pfx='src'>
+ <outcome value='success'>
+ <set>
+ <parameter name='src-node-id' value='`$src.pnf-name`' />
+ <parameter name='src-esr-id' value='`$src.controller-id`' />
+ </set>
</outcome>
+ </get-resource>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value='`$src-esr-id`'/>
+ <parameter name="regex" value="_"/>
+ <parameter name="ctx_memory_result_key" value="param-prefix"/>
+ </execute>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+key='SELECT *
+from TOPOLOGY_LOGICAL_RELATION_TO_PINTERFACE
+WHERE interface_name = $dst-port-id'
+pfx='dst'>
+ <outcome value='success'>
+ <set>
+ <parameter name='dst-node-id' value='`$dst.pnf-name`' />
+ <parameter name='dst-esr-id' value='`$dst.controller-id`' />
+ </set>
+ </outcome>
+ </get-resource>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value='`$dst-esr-id`'/>
+ <parameter name="regex" value="_"/>
+ <parameter name="ctx_memory_result_key" value="param-prefix1"/>
+ </execute>
+ <set>
+ <parameter name='src-controller-id' value='`$param-prefix[2]`' />
+ <parameter name='dst-controller-id' value='`$param-prefix1[2]`' />
+ <parameter name='flag' value='true' />
+ <parameter name='domain-requests' value='' />
+ <parameter name='access-status' value='success' />
+ <parameter name='domain-status' value='' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='generateUUID' >
+ <parameter name="ctx-destination" value="oof-request-id"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='generateUUID' >
+ <parameter name="ctx-destination" value="oof-transaction-id"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/oof-mdons.json'`" />
+ <parameter name="restapiUrl" value="` $prop.oof.mdons.url`" />
+ <parameter name="restapiUser" value="admin"/>
+ <parameter name="restapiPassword" value="admin"/>
+ <parameter name="httpMethod" value="POST"/>
+ <parameter name="responsePrefix" value="oof-response"/>
+ <parameter name='contentType' value='application/json' />
+ <parameter name='format' value='json' />
<outcome value='failure'>
<return status='failure'>
<parameter name='error-code' value='500' />
- <parameter name='error-message' value='Could not retrieve logical-links' />
+ <parameter name='error-message' value='No service route found by OOF' />
<parameter name='ack-final-indicator' value="Y" />
</return>
</outcome>
<outcome value='success'>
- <block atomic="true">
- <for index='ida' start='0' end='`$inter.logical-link_length`' >
- <switch test='`$inter.logical-link[$ida].link-type`'>
- <outcome value='inter-domain'>
- <switch test='`$inter.logical-link[$ida].operational-status == occupied`'>
- <outcome value='true'></outcome>
- <outcome value='false'>
- <block atomic="true">
- <set>
- <parameter name='access-bend' value='`$inter.logical-link[$ida].relationship-list.relationship[0].relationship-data[1].relationship-value`' />
- <parameter name='access-cend' value='`$inter.logical-link[$ida].relationship-list.relationship[1].relationship-data[1].relationship-value`' />
- </set>
- <break/>
- </block>
- </outcome>
- </switch>
- </outcome>
- </switch>
+ <block atomic='true'>
+ <for index='idml' start='0' end='`$oof-response.solutions.routeInfo.linkList_length`' >
+ <block atomic='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+resource="logical-link"
+key="logical-link.link-name = $oof-response.solutions.routeInfo.linkList[$idml]"
+pfx='inter' local-only='false' ></get-resource>
+ <switch test="`$inter.operational-status == up`">
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='flag' value='false' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
</for>
- <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
- <parameter name="file" value="/opt/opendaylight/current/data/log/inter-domain.log" />
- <parameter name="level" value="info" />
- <parameter name="field1" value="`'Aaccess bend---' + $access-bend`"/>
- <parameter name="field2" value="`'Aaccess cend---' + $access-cend`"/>
- <parameter name="field3" value="`'Service 1 req id---' + $service1-request-id`"/>
- <parameter name="field4" value="`'Service 2 req id---' + $service2-request-id`"/>
- </record>
- <switch test="`$access-bend == ''`">
- <outcome value='true'>
+ <switch test="`$flag == 'true' `">
+ <outcome value='false'>
<return status='failure'>
<parameter name='error-code' value='500' />
- <parameter name='error-message' value='No inter-domain-links available' />
+ <parameter name='error-message' value='Inter domain links not available' />
<parameter name='ack-final-indicator' value="Y" />
</return>
</outcome>
- <outcome value='false'>
- <block atomic="true">
- <set>
- <parameter name='access-service-name' value='`$optical-service-create-input.payload.service-name`' />
- </set>
- <for index='idb' start='0' end='2' >
- <switch test='`$idb`'>
- <outcome value='0'>
- <block atomic="true">
+ <outcome value='true'>
+ <block atomic='true'>
+ <for index='idmk' start='0' end='`$oof-response.solutions.routeInfo.linkList_length`' >
+ <block>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='logical-link'
+ key='logical-link.link-name = $oof-response.solutions.routeInfo.linkList[$idmk]'
+ local-only='false'>
+ <parameter name='operational-status' value='occupied' />
+ </update>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <for index='idomainsvc' start='0' end='`$oof-response.solutions.routeInfo.serviceRoute_length`' >
+ <block atomic='true'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='generateUUID' >
+ <parameter name="ctx-destination" value="domain-request-id"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='generateUUID' >
+ <parameter name="ctx-destination" value="domain-instance-id"/>
+ </execute>
+ <switch test="`$idomainsvc == $oof-response.solutions.routeInfo.serviceRoute_length - 1`">
+ <outcome value='true'>
+ <set>
+ <parameter name='domain-requests' value="`$domain-requests + $domain-request-id`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <set>
+ <parameter name='domain-requests' value="`$domain-requests + $domain-request-id + ','`" />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='optical-service-create-input.payload.service-aend.port-id' value='`$oof-response.solutions.routeInfo.serviceRoute[$idomainsvc].srcInterfaceId`' />
+ <parameter name='optical-service-create-input.payload.service-zend.port-id' value='`$oof-response.solutions.routeInfo.serviceRoute[$idomainsvc].dstInterfaceId`' />
+ <parameter name='optical-service-create-input.payload.service-name' value="`$access-service-name + '_MDONS-OTN'`" />
+ <parameter name='domain-type' value="TAPI" />
+ <parameter name='optical-service-create-input.request-id' value="`$domain-request-id`" />
+ <parameter name='optical-service-create-input.service-id' value="`$domain-instance-id`" />
+ </set>
+ <call module='optical-service' rpc='main-create' mode='sync' >
+ <outcome value='success'>
+ <block atomic='true'>
+ <set>
+ <parameter name='service-status' value='`$final-response-code`' />
+ </set>
+ <switch test='`$service-status == 200`'>
+ <outcome value='true'>
<set>
- <parameter name='optical-service-create-input.payload.service-aend.port-id' value='`$access-aend`' />
- <parameter name='optical-service-create-input.payload.service-zend.port-id' value='`$access-bend`' />
- <parameter name='optical-service-create-input.payload.service-name' value="`$access-service-name + '_MDONS-OTN'`" />
- <parameter name='domain-type' value="TAPI" />
- <parameter name='optical-service-create-input.request-id' value="`$service1-request-id`" />
- <parameter name='optical-service-create-input.service-id' value="`$service1-svc-instance-id`" />
+ <parameter name='status' value='success' />
</set>
- <call module='optical-service' rpc='main-create' mode='sync' >
- <outcome value='success'>
- <block atomic="true">
- <set>
- <parameter name='service1-status' value='`$final-response-code`' />
- </set>
- <switch test='`$service1-status == 200`'>
- <outcome value='true'>
- <set>
- <parameter name='service1' value='success' />
- </set>
- </outcome>
- <outcome value='false'>
- <set>
- <parameter name='service1' value='failure' />
- </set>
- </outcome>
- </switch>
- </block>
- </outcome>
- <outcome value='failure'>
- <return status='failure'>
- <parameter name='error-code' value='500' />
- <parameter name='error-message' value='Main Create Dg not available' />
- <parameter name='ack-final-indicator' value="Y" />
- </return>
- </outcome>
- </call>
- </block>
- </outcome>
- <outcome value='1'>
- <block atomic="true">
+ </outcome>
+ <outcome value='false'>
<set>
- <parameter name='optical-service-create-input.payload.service-aend.port-id' value='`$access-cend`' />
- <parameter name='optical-service-create-input.payload.service-zend.port-id' value='`$access-zend`' />
- <parameter name='optical-service-create-input.payload.service-name' value="`$access-service-name + '_MDONS-OTN'`" />
- <parameter name='domain-type' value="TAPI" />
- <parameter name='optical-service-create-input.request-id' value="`$service2-request-id`" />
- <parameter name='optical-service-create-input.service-id' value="`$service2-svc-instance-id`" />
+ <parameter name='status' value='failure' />
+ <parameter name='access-status' value='failure' />
</set>
- <call module='optical-service' rpc='main-create' mode='sync' >
- <outcome value='success'>
- <block atomic="true">
- <set>
- <parameter name='service2-status' value='`$final-response-code`' />
- </set>
- <switch test='`$service2-status == 200`'>
- <outcome value='true'>
- <set>
- <parameter name='service2' value='success' />
- </set>
- </outcome>
- <outcome value='false'>
- <set>
- <parameter name='service2' value='success' />
- </set>
- </outcome>
- </switch>
- </block>
- </outcome>
- <outcome value='failure'>
- <return status='failure'>
- <parameter name='error-code' value='500' />
- <parameter name='error-message' value='Main Create Dg not available' />
- <parameter name='ack-final-indicator' value="Y" />
- </return>
- </outcome>
- </call>
- </block>
- </outcome>
- </switch>
- </for>
- <set>
- <parameter name='inter' value='' />
- </set>
- <switch test='`$service1 == $service2 == success`'>
- <outcome value='true'>
- <block>
- <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='domain-status' value="`$domain-status + $domain-request-id + '_' + $status` " />
+ </set>
+ </block>
+ </outcome>
+ </call>
+ </block>
+ </for>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/oof-mdons.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Domain Status"/>
+ <parameter name="field2" value="`$domain-status`"/>
+ <parameter name="field3" value="`$flag`"/>
+ <parameter name="field4" value="`$access-status`"/>
+ </record>
+ <switch test="`$access-status == 'success'`">
+ <outcome value='true'>
+ <block atomic='true'>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
-key='UPDATE REQUEST_DETAILS SET status = "CREATED" WHERE request_id = $as-request-id'
+key='UPDATE REQUEST_DETAILS SET status = "CREATED", domain_requests = $domain-requests WHERE request_id = $access-request-id'
force='true' pfx='save-result'></save>
- <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
-force='true'
-resource='logical-link'
- key='logical-link.link-name = $inter.logical-link[$ida].link-name '
- local-only='false'>
- <parameter name='operational-status' value='occupied' />
- </update>
- <call module='optical-service' rpc='create-service-relationship' mode='sync' ></call>
- <return status='success'>
- <parameter name='error-code' value='200' />
- <parameter name='error-message' value='Multi-domain-service successfully created' />
- <parameter name='ack-final-indicator' value="Y" />
- </return>
- </block>
- </outcome>
- <outcome value='false'>
- <block>
- <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
- <parameter name="file" value="/opt/opendaylight/current/data/log/inter-domain.log" />
- <parameter name="level" value="info" />
- <parameter name="field1" value="Access service creation failed"/>
- </record>
- <return status='failure'>
- <parameter name='error-code' value='500' />
- <parameter name='error-message' value='Multi-domain-service creation failed' />
- <parameter name='ack-final-indicator' value="Y" />
- </return>
- </block>
- </outcome>
- </switch>
+ <call module='optical-service' rpc='create-service-relationship' mode='sync' ></call>
+ <return status='success'>
+ <parameter name='error-code' value='200' />
+ <parameter name='error-message' value='Multi-domain-service successfully created' />
+ <parameter name='ack-final-indicator' value="Y" />
+ </return>
</block>
</outcome>
</switch>
</block>
</outcome>
- </get-resource>
+ </execute>
</block>
</method>
</service-logic> \ No newline at end of file
diff --git a/platform-logic/optical-service/src/main/xml/optical-service_mdons-closed-loop.xml b/platform-logic/optical-service/src/main/xml/optical-service_mdons-closed-loop.xml
new file mode 100644
index 00000000..13061e57
--- /dev/null
+++ b/platform-logic/optical-service/src/main/xml/optical-service_mdons-closed-loop.xml
@@ -0,0 +1,237 @@
+<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='optical-service' version='${project.version}'>
+ <method rpc='mdons-closed-loop' mode='sync'>
+ <block>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+key='SELECT *
+from REQUEST_DETAILS
+WHERE service_instance_id = $access-service-id'
+pfx='access'></get-resource>
+ <set>
+ <parameter name='original-name' value='`$service-name`' />
+ </set>
+ <set>
+ <parameter name='domain-services' value='`$access.domain-requests`' />
+ <parameter name='pinterface-list' value='`$access.pinterface-list`' />
+ <parameter name='optical-service-delete-input.request-id' value='`$access.request-id`' />
+ <parameter name='optical-service-delete-input.payload.param[0].name' value='service-name' />
+ <parameter name='optical-service-delete-input.payload.param[0].value' value='`$service-name`' />
+ <parameter name='service-instance-id' value='`$access.service-instance-id`' />
+ <parameter name='service-rate' value='`$access.service-rate`' />
+ <parameter name='service-type' value='`$access.service-type`' />
+ <parameter name='global-customer-id' value='`$access.global-customer-id`' />
+ <parameter name='notification-url' value='`$access.notification-url`' />
+ </set>
+ <call module='optical-service' rpc='optical-service-delete' mode='sync' ></call>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/mdons-closed-loop.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Delete successful"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value='`$pinterface-list`'/>
+ <parameter name="regex" value=","/>
+ <parameter name="ctx_memory_result_key" value="param-prefix"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value='`$param-prefix[0]`'/>
+ <parameter name="regex" value="--"/>
+ <parameter name="ctx_memory_result_key" value="new-aend"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value='`$param-prefix[1]`'/>
+ <parameter name="regex" value="--"/>
+ <parameter name="ctx_memory_result_key" value="new-zend"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value='`$new-aend[0]`'/>
+ <parameter name="regex" value="_"/>
+ <parameter name="ctx_memory_result_key" value="coding1"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value='`$new-zend[0]`'/>
+ <parameter name="regex" value="_"/>
+ <parameter name="ctx_memory_result_key" value="coding2"/>
+ </execute>
+ <set>
+ <parameter name='optical-service-create-input.payload.param_length' value='7' />
+ </set>
+ <for index='ido' start='0' end='`$optical-service-create-input.payload.param_length`' >
+ <switch test='`$ido`'>
+ <outcome value='0'>
+ <block>
+ <set>
+ <parameter name='optical-service-create-input.payload.param[$ido].name' value='service-name' />
+ <parameter name='optical-service-create-input.payload.param[$ido].value' value='`$original-name`' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/mdons-closed-loop.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Param details 0"/>
+ <parameter name="field2" value="`$optical-service-create-input.payload.param[$ido].name`"/>
+ <parameter name="field3" value="`$optical-service-create-input.payload.param[$ido].value`"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='1'>
+ <block>
+ <set>
+ <parameter name='optical-service-create-input.payload.param[$ido].name' value='`$new-aend[0]`' />
+ <parameter name='optical-service-create-input.payload.param[$ido].value' value='`$new-aend[1]`' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/mdons-closed-loop.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Param details 1"/>
+ <parameter name="field2" value="`$optical-service-create-input.payload.param[$ido].name`"/>
+ <parameter name="field3" value="`$optical-service-create-input.payload.param[$ido].value`"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='2'>
+ <block>
+ <set>
+ <parameter name='optical-service-create-input.payload.param[$ido].name' value='`$new-zend[0]`' />
+ <parameter name='optical-service-create-input.payload.param[$ido].value' value='`$new-zend[1]`' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/mdons-closed-loop.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Param details 2"/>
+ <parameter name="field2" value="`$optical-service-create-input.payload.param[$ido].name`"/>
+ <parameter name="field3" value="`$optical-service-create-input.payload.param[$ido].value`"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='3'>
+ <block>
+ <set>
+ <parameter name='optical-service-create-input.payload.param[$ido].name' value="`$coding1[0] + '_coding_func'`" />
+ <parameter name='optical-service-create-input.payload.param[$ido].value' value='`$service-rate`' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/mdons-closed-loop.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Param details 3"/>
+ <parameter name="field2" value="`$optical-service-create-input.payload.param[$ido].name`"/>
+ <parameter name="field3" value="`$optical-service-create-input.payload.param[$ido].value`"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='4'>
+ <block>
+ <set>
+ <parameter name='optical-service-create-input.payload.param[$ido].name' value="`$coding2[0] + '_coding_func'`" />
+ <parameter name='optical-service-create-input.payload.param[$ido].value' value='`$service-rate`' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/mdons-closed-loop.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Param details 4"/>
+ <parameter name="field2" value="`$optical-service-create-input.payload.param[$ido].name`"/>
+ <parameter name="field3" value="`$optical-service-create-input.payload.param[$ido].value`"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='5'>
+ <block>
+ <set>
+ <parameter name='optical-service-create-input.payload.param[$ido].name' value="`$coding1[0] + '_client_proto'`" />
+ <parameter name='optical-service-create-input.payload.param[$ido].value' value='Ethernet' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/mdons-closed-loop.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Param details 5"/>
+ <parameter name="field2" value="`$optical-service-create-input.payload.param[$ido].name`"/>
+ <parameter name="field3" value="`$optical-service-create-input.payload.param[$ido].value`"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='6'>
+ <block>
+ <set>
+ <parameter name='optical-service-create-input.payload.param[$ido].name' value="`$coding2[0] + '_client_proto'`" />
+ <parameter name='optical-service-create-input.payload.param[$ido].value' value='Ethernet' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/mdons-closed-loop.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Param details 6"/>
+ <parameter name="field2" value="`$optical-service-create-input.payload.param[$ido].name`"/>
+ <parameter name="field3" value="`$optical-service-create-input.payload.param[$ido].value`"/>
+ </record>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='optical-service-create-input.request-id' value='`$access.request-id`' />
+ <parameter name='optical-service-create-input.global-customer-id' value='`$global-customer-id`' />
+ <parameter name='optical-service-create-input.service-type' value='`$service-type`' />
+ <parameter name='optical-service-create-input.notification-url' value='`$notification-url`' />
+ <parameter name='optical-service-create-input.service-id' value='`$service-instance-id`' />
+ <parameter name='optical-service-create-input.source' value='SO' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/mdons-closed-loop.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Length"/>
+ <parameter name="field2" value="`$optical-service-create-input.payload.param_length`"/>
+ <parameter name="field" value="`$access.service-instance-id`"/>
+ </record>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+resource="service-instance"
+ key='customer.global-customer-id = $global-customer-id AND
+ service-subscription.service-type = $service-type AND
+ service-instance.service-instance-id = $access.service-instance-id'
+pfx='mdons-access' local-only='false'></get-resource>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/mdons-closed-loop.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Service Details"/>
+ <parameter name="field3" value="`$access.service-instance-id`"/>
+ <parameter name="field4" value="`$mdons-access.model-invariant-id`"/>
+ <parameter name="field5" value="`$mdons-access.input-parameters`"/>
+ </record>
+ <for index='idl' start='0' end='`$mdons-access.relationship-list.relationship_length`' >
+ <switch test="`$mdons-access.relationship-list.relationship[$idl].related-to == 'logical-link'`">
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='link-name' value='`$mdons-access.relationship-list.relationship[$idl].relationship-data[0].relationship-value`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='logical-link'
+ key='logical-link.link-name = $link-name '
+ local-only='false'>
+ <parameter name='operational-status' value='down' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+resource="service-instance"
+key='customer.global-customer-id = $global-customer-id AND
+service-subscription.service-type = $service-type AND
+service-instance.service-instance-id = $access.service-instance-id'></delete>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='service-instance'
+ key='customer.global-customer-id = $global-customer-id AND
+ service-subscription.service-type = $service-type AND
+ service-instance.service-instance-id = $access.service-instance-id' >
+ <parameter name='service-instance-id' value='`$mdons-access.service-instance-id`' />
+ <parameter name='service-instance-name' value='`$mdons-access.service-instance-name`' />
+ <parameter name='service-type' value='`$mdons-access.service-type`' />
+ <parameter name='orchestration-status' value='`$mdons-access.orchestration-status`' />
+ <parameter name='service-role' value='`$mdons-access.service-role`' />
+ <parameter name='model-invariant-id' value='`$mdons-access.model-invariant-id`' />
+ <parameter name='model-version-id' value='`$mdons-access.model-version-id`' />
+ <parameter name='input-parameters' value='`$mdons-access.input-parameters`' />
+ </save>
+ <call module='optical-service' rpc='optical-service-create' mode='sync' ></call>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/platform-logic/optical-service/src/main/xml/optical-service_optical-service-create-sync-success.xml b/platform-logic/optical-service/src/main/xml/optical-service_optical-service-create-sync-success.xml
index 4eed4026..0eaf0d82 100644
--- a/platform-logic/optical-service/src/main/xml/optical-service_optical-service-create-sync-success.xml
+++ b/platform-logic/optical-service/src/main/xml/optical-service_optical-service-create-sync-success.xml
@@ -38,7 +38,7 @@ key = 'pnf.pnf-name = $z-end-pnf-name
local-only='false'>
<parameter name='available-capacity' value='`$available-bandwidth-zend`' />
</update>
- <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL" key="INSERT INTO REQUEST_DETAILS (request_id, controller_id, status, service_rate, service_instance_id, service_type, global_customer_id, notification_url) VALUES ( $optical-service-create-input.request-id , $controller-id , 'CREATED' , $optical-service-create-input.payload.service-rate , $optical-service-create-input.service-id , $optical-service-create-input.service-type , $optical-service-create-input.global-customer-id , $optical-service-create-input.notification-url );"></save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL" key="INSERT INTO REQUEST_DETAILS (request_id, controller_id, status, service_rate, service_instance_id, service_type, global_customer_id, notification_url) VALUES ( $optical-service-create-input.request-id , $controller-id , 'CREATING' , $optical-service-create-input.payload.service-rate , $optical-service-create-input.service-id , $optical-service-create-input.service-type , $optical-service-create-input.global-customer-id , $optical-service-create-input.notification-url );"></save>
<save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='service-instance'
key='customer.global-customer-id = $optical-service-create-input.global-customer-id AND
service-subscription.service-type = $optical-service-create-input.service-type AND
@@ -46,7 +46,7 @@ key = 'pnf.pnf-name = $z-end-pnf-name
<parameter name='service-instance-id' value='`$optical-service-create-input.service-id`' />
<parameter name='service-instance-name' value='`$optical-service-create-input.payload.service-name`' />
<parameter name='service-type' value='Domain-Service' />
- <parameter name='orchestration-status' value='CREATED' />
+ <parameter name='orchestration-status' value='CREATING' />
<parameter name='service-rate' value='`$optical-service-create-input.payload.service-rate`' />
<parameter name='service-layer' value='`$optical-service-create-input.payload.service-layer`' />
</save>
diff --git a/platform-logic/optical-service/src/main/xml/optical-service_optical-service-create.xml b/platform-logic/optical-service/src/main/xml/optical-service_optical-service-create.xml
index 2341c607..9cc17364 100644
--- a/platform-logic/optical-service/src/main/xml/optical-service_optical-service-create.xml
+++ b/platform-logic/optical-service/src/main/xml/optical-service_optical-service-create.xml
@@ -3,6 +3,9 @@
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='optical-service' version='${project.version}'>
<method rpc='optical-service-create' mode='sync'>
<block atomic='true'>
+ <set>
+ <parameter name='pinterface-list' value=""/>
+ </set>
<for index='idx' start='0' end='`$optical-service-create-input.payload.param_length`' >
<set>
<parameter name='params' value='`$optical-service-create-input.payload.param[$idx]`' />
@@ -11,6 +14,7 @@
<outcome value='true'>
<set>
<parameter name='optical-service-create-input.payload.service-aend.port-id' value="`$optical-service-create-input.payload.param[$idx].value`"/>
+ <parameter name='pinterface-aend' value="`'uni1_id--'+ $optical-service-create-input.payload.param[$idx].value`"/>
</set>
</outcome>
</switch>
@@ -23,6 +27,7 @@
<outcome value='true'>
<set>
<parameter name='optical-service-create-input.payload.service-zend.port-id' value="`$optical-service-create-input.payload.param[$idx].value`"/>
+ <parameter name='pinterface-zend' value="`',uni2_id--'+ $optical-service-create-input.payload.param[$idx].value`"/>
</set>
</outcome>
</switch>
@@ -42,6 +47,7 @@
<outcome value='true'>
<set>
<parameter name='optical-service-create-input.payload.service-aend.port-id' value="`$optical-service-create-input.payload.param[$idx].value`"/>
+ <parameter name='pinterface-aend' value="`'uni_id--'+ $optical-service-create-input.payload.param[$idx].value`"/>
</set>
</outcome>
</switch>
@@ -49,6 +55,7 @@
<outcome value='true'>
<set>
<parameter name='optical-service-create-input.payload.service-zend.port-id' value="`$optical-service-create-input.payload.param[$idx].value`"/>
+ <parameter name='pinterface-zend' value="`',enni_id--'+ $optical-service-create-input.payload.param[$idx].value`"/>
</set>
</outcome>
</switch>
@@ -63,6 +70,7 @@
<outcome value='true'>
<set>
<parameter name='optical-service-create-input.payload.service-aend.port-id' value="`$optical-service-create-input.payload.param[$idx].value`"/>
+ <parameter name='pinterface-aend' value="`'enni1_id--'+ $optical-service-create-input.payload.param[$idx].value`"/>
</set>
</outcome>
</switch>
@@ -70,6 +78,7 @@
<outcome value='true'>
<set>
<parameter name='optical-service-create-input.payload.service-zend.port-id' value="`$optical-service-create-input.payload.param[$idx].value`"/>
+ <parameter name='pinterface-zend' value="`',enni2_id--'+ $optical-service-create-input.payload.param[$idx].value`"/>
</set>
</outcome>
</switch>
@@ -145,11 +154,21 @@ pfx='db.source2'>
<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='generateUUID' >
<parameter name="ctx-destination" value="service2-request-id"/>
</execute>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/optical-service-create.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Controller Ids"/>
+ <parameter name="field2" value="`$controller1`"/>
+ <parameter name="field3" value="`$controller2`"/>
+ </record>
+ <set>
+ <parameter name='pinterface-list' value="`$pinterface-aend + $pinterface-zend`"/>
+ </set>
<switch test='`$controller1==$controller2`'>
<outcome value='true'>
<block>
<set>
- <parameter name='as-request-id' value='`$optical-service-create-input.request-id`' />
+ <parameter name='access-request-id' value='`$optical-service-create-input.request-id`' />
<parameter name='as-svc-instance-id' value='`$optical-service-create-input.service-id`' />
</set>
<set>
@@ -164,22 +183,29 @@ pfx='db.source2'>
<parameter name="field1" value="`'domain rquest_' + $domain-requests`"/>
<parameter name="field2" value="`'Access rquest_' + $as-request-id`"/>
</record>
- <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL" key="INSERT INTO REQUEST_DETAILS (request_id, controller_id, status, service_rate, service_instance_id, service_type, global_customer_id, notification_url, domain_requests ) VALUES ( $as-request-id , null , 'CREATING' , $optical-service-create-input.payload.service-rate , $as-svc-instance-id , $optical-service-create-input.service-type , $optical-service-create-input.global-customer-id , $optical-service-create-input.notification-url , $domain-requests );"></save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL" key="INSERT INTO REQUEST_DETAILS (request_id, controller_id, status, service_rate, service_instance_id, service_type, global_customer_id, notification_url, domain_requests, pinterface_list ) VALUES ( $access-request-id , null , 'CREATING' , $optical-service-create-input.payload.service-rate , $as-svc-instance-id , $optical-service-create-input.service-type , $optical-service-create-input.global-customer-id , $optical-service-create-input.notification-url , $domain-requests , $pinterface-list );"></save>
<call module='optical-service' rpc='main-create' mode='sync' >
<outcome value='success'>
<switch test='`$final-response-code`'>
<outcome value='200'>
<block>
- <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
-resource='SQL'
-key='UPDATE REQUEST_DETAILS SET status = "CREATED" WHERE request_id = $as-request-id'
-force='true' pfx='save-result'></save>
<call module='optical-service' rpc='create-service-relationship' mode='sync' ></call>
- <return status='success'>
- <parameter name='error-code' value='200' />
- <parameter name='error-message' value='Service Created Successfully' />
- <parameter name='ack-final-indicator' value='Y' />
- </return>
+ <switch test="`$domain-type == 'MSA'`">
+ <outcome value='true'>
+ <return status='success'>
+ <parameter name='error-code' value='200' />
+ <parameter name='error-message' value='Service Created Successfully' />
+ <parameter name='ack-final-indicator' value='N' />
+ </return>
+ </outcome>
+ <outcome value='false'>
+ <return status='success'>
+ <parameter name='error-code' value='200' />
+ <parameter name='error-message' value='Service Created Successfully' />
+ <parameter name='ack-final-indicator' value='Y' />
+ </return>
+ </outcome>
+ </switch>
</block>
</outcome>
</switch>
@@ -190,22 +216,23 @@ force='true' pfx='save-result'></save>
<outcome value='false'>
<block>
<set>
- <parameter name='as-request-id' value='`$optical-service-create-input.request-id`' />
+ <parameter name='access-request-id' value='`$optical-service-create-input.request-id`' />
<parameter name='as-svc-instance-id' value='`$optical-service-create-input.service-id`' />
- <parameter name='domain-requests' value="`$service1-request-id + ',' + $service2-request-id`" />
+ <parameter name='service-rate' value='`$optical-service-create-input.payload.service-rate`' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL" key="INSERT INTO REQUEST_DETAILS (request_id, controller_id, status, service_rate, service_instance_id, service_type, global_customer_id, notification_url, domain_requests, pinterface_list ) VALUES ( $access-request-id , null , 'CREATING' , $service-rate , $as-svc-instance-id , $optical-service-create-input.service-type , $optical-service-create-input.global-customer-id , $optical-service-create-input.notification-url , $domain-requests , $pinterface-list );"></save>
+ <set>
+ <parameter name='src-port-id' value="`$optical-service-create-input.payload.service-aend.port-id`"/>
+ <parameter name='dst-port-id' value="`$optical-service-create-input.payload.service-zend.port-id`"/>
+ <parameter name='access-service-name' value="`$optical-service-create-input.payload.service-name`"/>
</set>
<record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
<parameter name="file" value="/opt/opendaylight/current/data/log/optical-service-create.log" />
<parameter name="level" value="info" />
- <parameter name="field1" value="`'domain rquest_' + $domain-requests`"/>
- <parameter name="field2" value="`'Service 1 req id---' + $service1-request-id`"/>
- <parameter name="field3" value="`'Service 2 req id---' + $service2-request-id`"/>
+ <parameter name="field1" value="Access service details"/>
+ <parameter name="field2" value="`$access-request-id`"/>
+ <parameter name="field3" value="`$src-port-id`"/>
</record>
- <save plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL" key="INSERT INTO REQUEST_DETAILS (request_id, controller_id, status, service_rate, service_instance_id, service_type, global_customer_id, notification_url, domain_requests ) VALUES ( $as-request-id , null , 'CREATING' , $optical-service-create-input.payload.service-rate , $as-svc-instance-id , $optical-service-create-input.service-type , $optical-service-create-input.global-customer-id , $optical-service-create-input.notification-url , $domain-requests );"></save>
- <set>
- <parameter name='access-aend' value="`$optical-service-create-input.payload.service-aend.port-id`"/>
- <parameter name='access-zend' value="`$optical-service-create-input.payload.service-zend.port-id`"/>
- </set>
<call module='optical-service' rpc='inter-domain-handling' mode='sync' ></call>
</block>
</outcome>
diff --git a/platform-logic/optical-service/src/main/xml/optical-service_optical-service-delete.xml b/platform-logic/optical-service/src/main/xml/optical-service_optical-service-delete.xml
index 2bbd79e3..33d17829 100644
--- a/platform-logic/optical-service/src/main/xml/optical-service_optical-service-delete.xml
+++ b/platform-logic/optical-service/src/main/xml/optical-service_optical-service-delete.xml
@@ -16,6 +16,7 @@ pfx='detail-db'>
<set>
<parameter name='domain-req' value='`$detail-db.domain-requests`' />
<parameter name='delete-acc-svc-id' value='`$detail-db.service-instance-id`' />
+ <parameter name='access-id' value='`$optical-service-delete-input.request-id`' />
</set>
</outcome>
</get-resource>
@@ -25,18 +26,23 @@ pfx='detail-db'>
<parameter name="ctx_memory_result_key" value="param-prefix1"/>
</execute>
<set>
- <parameter name='notification-url' value="http://167.254.204.152:31817/asyncNotification" />
- <parameter name='domain-service1' value='`$param-prefix1[0]`' />
- <parameter name='domain-service2' value='`$param-prefix1[1]`' />
+ <parameter name='notification-url' value="notificationUrl" />
+ <parameter name='access-status' value="success" />
</set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/new.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="`$domain-req`"/>
+ <parameter name="field2" value="`$domain-service1`"/>
+ </record>
<for index='ppx' start='0' end='`$param-prefix1_length`' >
- <switch test='`$param-prefix1_length`'>
- <outcome value='1'>
+ <switch test='`$param-prefix1_length == 1`'>
+ <outcome value='true'>
<block atomic='true'>
<get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key='SELECT controller_id
from REQUEST_DETAILS
-WHERE request_id = $domain-service1'
+WHERE request_id = $param-prefix1[$ppx]'
pfx='detail-db1'>
<outcome value='success'>
<set>
@@ -52,8 +58,9 @@ pfx='detail-db1'>
<set>
<parameter name='domain-type' value='`$param-prefix[0]`' />
<parameter name='controller-ip' value='`$param-prefix[1]`' />
- <parameter name='optical-service-delete-input.request-id' value="`$domain-service1`" />
+ <parameter name='optical-service-delete-input.request-id' value="`$param-prefix1[$ppx]`" />
<parameter name='optical-service-delete-input.payload.service-name' value="`$optical-service-delete-input.payload.param[0].value + '_MDONS-OTN_'`"/>
+ <parameter name='domain-service1' value="`$param-prefix1[$ppx]`" />
</set>
<switch test='`$domain-type`'>
<outcome value='MSA'>
@@ -104,122 +111,51 @@ pfx='detail-db1'>
</switch>
</block>
</outcome>
- <outcome value='2'>
- <switch test='`$ppx`'>
- <outcome value='0'>
- <block>
- <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ <outcome value='false'>
+ <block>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key='SELECT controller_id
from REQUEST_DETAILS
-WHERE request_id = $domain-service1'
+WHERE request_id = $param-prefix1[$ppx]'
pfx='detail-db11'>
- <outcome value='success'>
- <set>
- <parameter name='controller-id11' value='`$detail-db11.controller-id`' />
- </set>
- </outcome>
- </get-resource>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
- <parameter name="original_string" value='`$controller-id11`'/>
- <parameter name="regex" value="_"/>
- <parameter name="ctx_memory_result_key" value="domain1"/>
- </execute>
- <set>
- <parameter name='optical-service-delete-input.request-id' value="`$domain-service1`" />
- <parameter name='optical-service-delete-input.payload.service-name' value="`$optical-service-delete-input.payload.param[0].value + '_MDONS-OTN_'`"/>
- <parameter name='domain-type' value='`$domain1[0]`' />
- <parameter name='controller-ip' value='`$domain1[1]`' />
- </set>
- <call module='optical-service' rpc='service-delete-tapi' mode='sync' >
- <outcome value='success'>
- <block>
- <set>
- <parameter name='service1-status' value='`$final-response-code`' />
- </set>
- <switch test='`$service1-status == 200`'>
- <outcome value='true'>
- <set>
- <parameter name='service1' value='success' />
- </set>
- </outcome>
- <outcome value='false'>
- <set>
- <parameter name='service1' value='failure' />
- </set>
- </outcome>
- </switch>
- </block>
- </outcome>
- <outcome value='failure'>
- <return status='failure'>
- <parameter name='error-code' value='500' />
- <parameter name='error-message' value='Main Delete Dg not available' />
- <parameter name='ack-final-indicator' value="Y" />
- </return>
- </outcome>
- </call>
- </block>
- </outcome>
- <outcome value='1'>
- <block>
- <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
-key='SELECT controller_id
-from REQUEST_DETAILS
-WHERE request_id = $domain-service2'
-pfx='detail-db22'>
- <outcome value='success'>
- <set>
- <parameter name='controller-id22' value='`$detail-db22.controller-id`' />
- </set>
- </outcome>
- </get-resource>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
- <parameter name="original_string" value='`$controller-id22`'/>
- <parameter name="regex" value="_"/>
- <parameter name="ctx_memory_result_key" value="domain2"/>
- </execute>
+ <outcome value='success'>
<set>
- <parameter name='optical-service-delete-input.request-id' value="`$domain-service2`" />
- <parameter name='optical-service-delete-input.payload.service-name' value="`$optical-service-delete-input.payload.param[0].value + '_MDONS-OTN_'`"/>
- <parameter name='domain-type' value='`$domain2[0]`' />
- <parameter name='controller-ip' value='`$domain2[1]`' />
+ <parameter name='controller-id11' value='`$detail-db11.controller-id`' />
</set>
- <call module='optical-service' rpc='service-delete-tapi' mode='sync' >
- <outcome value='success'>
- <block>
+ </outcome>
+ </get-resource>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value='`$controller-id11`'/>
+ <parameter name="regex" value="_"/>
+ <parameter name="ctx_memory_result_key" value="domain1"/>
+ </execute>
+ <set>
+ <parameter name='optical-service-delete-input.request-id' value="`$param-prefix1[$ppx]`" />
+ <parameter name='optical-service-delete-input.payload.service-name' value="`$optical-service-delete-input.payload.param[0].value + '_MDONS-OTN_'`"/>
+ </set>
+ <call module='optical-service' rpc='service-delete-tapi' mode='sync' >
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='service-status' value='`$final-response-code`' />
+ </set>
+ <switch test='`$service-status == 200`'>
+ <outcome value='true'></outcome>
+ <outcome value='false'>
<set>
- <parameter name='service2-status' value='`$final-response-code`' />
+ <parameter name='access-status' value='failure' />
</set>
- <switch test='`$service2-status == 200`'>
- <outcome value='true'>
- <set>
- <parameter name='service2' value='success' />
- </set>
- </outcome>
- <outcome value='false'>
- <set>
- <parameter name='service2' value='failure' />
- </set>
- </outcome>
- </switch>
- </block>
- </outcome>
- <outcome value='failure'>
- <return status='failure'>
- <parameter name='error-code' value='500' />
- <parameter name='error-message' value='Main Delete Dg not available' />
- <parameter name='ack-final-indicator' value="Y" />
- </return>
- </outcome>
- </call>
- </block>
- </outcome>
- </switch>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </call>
+ </block>
</outcome>
</switch>
</for>
- <switch test='`$ppx`'>
- <outcome value='0'>
+ <switch test='`$ppx == 0`'>
+ <outcome value='true'>
<block>
<switch test='`$service1-status`'>
<outcome value='200'>
@@ -246,54 +182,52 @@ pfx='detail-db22'>
</switch>
</block>
</outcome>
- <outcome value='1'>
- <block>
- <switch test='`$service1-status == $service2-status == 200`'>
- <outcome value='true'>
- <block>
- <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ <outcome value='false'>
+ <switch test='`$access-status == success`'>
+ <outcome value='true'>
+ <block>
+ <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource="SQL"
key="DELETE FROM REQUEST_DETAILS WHERE request_id = $access-id"></delete>
- <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
- <parameter name="file" value="/opt/opendaylight/current/data/log/optical-service-create.log" />
- <parameter name="level" value="info" />
- <parameter name="field1" value="`'domain rquest_' + $domain-requests`"/>
- <parameter name="field2" value="`'Access rquest_' + $as-request-id`"/>
- </record>
- <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="service-instance"
key='customer.global-customer-id = $output.global-customer-id AND
service-subscription.service-type = $output.service-type AND
service-instance.service-instance-id = $delete-acc-svc-id'
pfx='acc-serv-dl' local-only='false'></get-resource>
- <set>
- <parameter name='link-name' value='`$acc-serv-dl.relationship-list.relationship[0].relationship-data[0].relationship-value`' />
- </set>
- <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+ <for index='idl' start='0' end='`$acc-serv-dl.relationship-list.relationship_length`' >
+ <switch test="`$acc-serv-dl.relationship-list.relationship[$idl].related-to == 'logical-link'`">
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='link-name' value='`$acc-serv-dl.relationship-list.relationship[$idl].relationship-data[0].relationship-value`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
force='true'
resource='logical-link'
key='logical-link.link-name = $link-name '
local-only='false'>
- <parameter name='operational-status' value='available' />
- </update>
- <return status='success'>
- <parameter name="error-code" value="200" />
- <parameter name="error-message" value="Service Deleted Successfully" />
- <parameter name='ack-final-indicator' value='Y' />
- </return>
- </block>
- </outcome>
- <outcome value='false'>
- <block>
- <return status='failure'>
- <parameter name='error-code' value='500' />
- <parameter name='error-message' value='Access service request entry cannot be deleted' />
- <parameter name='ack-final-indicator' value="Y" />
- </return>
- </block>
- </outcome>
- </switch>
- </block>
+ <parameter name='operational-status' value='up' />
+ </update>
+ <return status='success'>
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="Service Deleted Successfully" />
+ <parameter name='ack-final-indicator' value='Y' />
+ </return>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Access service request entry cannot be deleted' />
+ <parameter name='ack-final-indicator' value="Y" />
+ </return>
+ </outcome>
+ </switch>
</outcome>
</switch>
</block>
diff --git a/platform-logic/optical-service/src/main/xml/optical-service_service-delete-tapi.xml b/platform-logic/optical-service/src/main/xml/optical-service_service-delete-tapi.xml
index 0d17afd2..4901bf0f 100644
--- a/platform-logic/optical-service/src/main/xml/optical-service_service-delete-tapi.xml
+++ b/platform-logic/optical-service/src/main/xml/optical-service_service-delete-tapi.xml
@@ -24,6 +24,7 @@ pfx='output'></get-resource>
</execute>
<set>
<parameter name='service-name' value="`$optical-service-delete-input.payload.service-name + $new-esr[2]`" />
+ <parameter name='controller-ip' value="`$new-esr[1]`" />
</set>
<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
<parameter name="restapiUrl" value="` $controller-ip + $prop.tapi.get.services.url + $service-name`" />