diff options
author | 2020-03-18 07:02:34 +0000 | |
---|---|---|
committer | 2020-03-18 07:03:20 +0000 | |
commit | 30093496695c9131b270a4b41d19ec88e818e66c (patch) | |
tree | 9e63b57d435efd544d6dab5bc194f564972b2da7 /platform-logic/optical-service/src/main/xml | |
parent | 779ea800e4a707cb856e6d5ed3d7bd263679e069 (diff) |
DG'S added for MDONS use case to handle cross domain
service creation
Change-Id: Ibb50d9c82cc6f62c58c8e85b7f088d40c2a7e30d
Issue-ID: SDNC-928
Signed-off-by: Mehreen Kaleem <mehreen.kaleem@us.fujitsu.com>
Former-commit-id: ee3ee6e27a76ef2c59da5961f0ec1572081aa0ad
Diffstat (limited to 'platform-logic/optical-service/src/main/xml')
4 files changed, 437 insertions, 56 deletions
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 new file mode 100644 index 00000000..669f3800 --- /dev/null +++ b/platform-logic/optical-service/src/main/xml/optical-service_create-service-relationship.xml @@ -0,0 +1,51 @@ +<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='create-service-relationship' mode='sync'>
+ <block atomic='true'>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+key='SELECT *
+from REQUEST_DETAILS
+WHERE request_id = $as-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`'/>
+ <parameter name="regex" value=","/>
+ <parameter name="ctx_memory_result_key" value="domain-services"/>
+ </execute>
+ <for index='idc' start='0' end='`$domain-services_length`' >
+ <block atomic='true'>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+key='SELECT *
+from REQUEST_DETAILS
+WHERE request_id = $domain-services[$idc]'
+pfx='ds-details'></get-resource>
+ <block atomic='true'>
+ <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="`'/business/customers/customer/' + $optical-service-create-input.global-customer-id + '/service-subscriptions/service-subscription/' + $optical-service-create-input.service-type + '/service-instances/service-instance/' + $ds-details.service-instance-id`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="service-instance.service-instance-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$ds-details.service-instance-id`" />
+ </save>
+ </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'
+ 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>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file 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 new file mode 100644 index 00000000..eb1ef93f --- /dev/null +++ b/platform-logic/optical-service/src/main/xml/optical-service_inter-domain-handling.xml @@ -0,0 +1,197 @@ +<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='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>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Could not retrieve logical-links' />
+ <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].available-capacity == 0`'>
+ <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>
+ </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'>
+ <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>
+ </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">
+ <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-TAPI-1'`" />
+ <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`" />
+ </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">
+ <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-TAPI-2'`" />
+ <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`" />
+ </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'
+resource='SQL'
+key='UPDATE REQUEST_DETAILS SET status = "CREATED" WHERE request_id = $as-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='available-capacity' value='0' />
+ </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>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </get-resource>
+ </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.xml b/platform-logic/optical-service/src/main/xml/optical-service_optical-service-create.xml index 240316ab..0c09b4a5 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,68 +3,203 @@ 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'>
- <call module='optical-service' rpc='optical-validate-input-params' mode='sync' ></call>
- <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 controller_id
-from TOPOLOGY_LOGICAL_RELATION_TO_PINTERFACE
-WHERE interface_name = $optical-service-create-input.payload.service-aend.port-id
-AND interface_id = $optical-service-create-input.payload.service-aend.port-name'
-pfx='controllerid'>
- <outcome value='success'>
- <set>
- <parameter name='controller-id' value='`$controllerid.controller-id`' />
- </set>
- </outcome>
- </get-resource>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
- <parameter name="original_string" value='`$controller-id`'/>
- <parameter name="regex" value="_"/>
- <parameter name="ctx_memory_result_key" value="param-prefix"/>
- </execute>
- <set>
- <parameter name='controller-ip' value='`$param-prefix[1]`' />
- </set>
- <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
-key='SELECT *
-from TOPOLOGY_LOGICAL_RELATION_TO_PINTERFACE
-WHERE interface_name = $optical-service-create-input.payload.service-aend.port-id
-AND interface_id = $optical-service-create-input.payload.service-aend.port-name'
-pfx='db-aend'>
+ <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]`' />
+ </set>
+ <switch test="`$optical-service-create-input.payload.param[$idx].name == 'uni1_id'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='optical-service-create-input.payload.service-aend.port-id' value="`$optical-service-create-input.payload.param[$idx].value`"/>
+ </set>
+ </outcome>
+ </switch>
+ <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="`$optical-service-create-input.payload.service-aend.port-id`"/>
+ </record>
+ <switch test="`$optical-service-create-input.payload.param[$idx].name == 'uni2_id'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='optical-service-create-input.payload.service-zend.port-id' value="`$optical-service-create-input.payload.param[$idx].value`"/>
+ </set>
+ </outcome>
+ </switch>
+ <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="`$optical-service-create-input.payload.service-zend.port-id`"/>
+ </record>
+ <switch test="`$optical-service-create-input.payload.param[$idx].name == 'uni1_coding_func'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='optical-service-create-input.payload.service-rate' value="`$optical-service-create-input.payload.param[$idx].value`"/>
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$optical-service-create-input.payload.param[$idx].name == 'uni_id'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='optical-service-create-input.payload.service-aend.port-id' value="`$optical-service-create-input.payload.param[$idx].value`"/>
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$optical-service-create-input.payload.param[$idx].name == 'enni_id'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='optical-service-create-input.payload.service-zend.port-id' value="`$optical-service-create-input.payload.param[$idx].value`"/>
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$optical-service-create-input.payload.param[$idx].name == 'uni_coding_func'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='optical-service-create-input.payload.service-rate' value="`$optical-service-create-input.payload.param[$idx].value`"/>
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$optical-service-create-input.payload.param[$idx].name == 'enni1_id'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='optical-service-create-input.payload.service-aend.port-id' value="`$optical-service-create-input.payload.param[$idx].value`"/>
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$optical-service-create-input.payload.param[$idx].name == 'enni2_id'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='optical-service-create-input.payload.service-zend.port-id' value="`$optical-service-create-input.payload.param[$idx].value`"/>
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$optical-service-create-input.payload.param[$idx].name == 'enni1_coding_func'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='optical-service-create-input.payload.service-rate' value="`$optical-service-create-input.payload.param[$idx].value`"/>
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$optical-service-create-input.payload.param[$idx].name == 'service-name'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='optical-service-create-input.payload.service-name' value="`$optical-service-create-input.payload.param[$idx].value`"/>
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+key='SELECT controller_id
+from TOPOLOGY_LOGICAL_RELATION_TO_PINTERFACE
+WHERE interface_name = $optical-service-create-input.payload.service-aend.port-id'
+pfx='db.source1'>
<outcome value='success'>
<set>
- <parameter name='aend-nodeid' value='`$db-aend.pnf-id`' />
- <parameter name='a-end-pnf-name' value='`$db-aend.pnf-name`' />
- <parameter name='aend-clli' value='`$db-aend.clli`' />
+ <parameter name='controller1' value="`$db.source1.controller-id`"/>
</set>
</outcome>
</get-resource>
- <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
-key='SELECT *
-from TOPOLOGY_LOGICAL_RELATION_TO_PINTERFACE
-WHERE interface_name = $optical-service-create-input.payload.service-zend.port-id
-AND interface_id = $optical-service-create-input.payload.service-zend.port-name'
-pfx='db-zend'>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+key='SELECT controller_id
+from TOPOLOGY_LOGICAL_RELATION_TO_PINTERFACE
+WHERE interface_name = $optical-service-create-input.payload.service-zend.port-id'
+pfx='db.source2'>
<outcome value='success'>
<set>
- <parameter name='zend-nodeid' value='`$db-zend.pnf-id`' />
- <parameter name='z-end-pnf-name' value='`$db-zend.pnf-name`' />
- <parameter name='zend-clli' value='`$db-zend.clli`' />
+ <parameter name='controller2' value="`$db.source2.controller-id`"/>
</set>
</outcome>
</get-resource>
- <switch test='`$optical-service-create-input.payload.domain-type`'>
- <outcome value='MSA'>
- <block atomic='true'>
- <call module='optical-service' rpc='service-create-msa' mode='sync' ></call>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='generateUUID' >
+ <parameter name="ctx-destination" value="service1-svc-instance-id"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value='`$controller1`'/>
+ <parameter name="regex" value="_"/>
+ <parameter name="ctx_memory_result_key" value="param-prefix1"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value='`$controller2`'/>
+ <parameter name="regex" value="_"/>
+ <parameter name="ctx_memory_result_key" value="param-prefix2"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='generateUUID' >
+ <parameter name="ctx-destination" value="service1-request-id"/>
+ </execute>
+ <set>
+ <parameter name='controller-ip1' value='`$param-prefix1[1]`' />
+ <parameter name='domain-type1' value='`$param-prefix1[0]`' />
+ <parameter name='controller-ip2' value='`$param-prefix2[1]`' />
+ <parameter name='domain-type2' value='`$param-prefix2[0]`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='generateUUID' >
+ <parameter name="ctx-destination" value="service2-svc-instance-id"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='generateUUID' >
+ <parameter name="ctx-destination" value="service2-request-id"/>
+ </execute>
+ <switch test='`$controller1==$controller2`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='as-request-id' value='`$optical-service-create-input.request-id`' />
+ <parameter name='as-svc-instance-id' value='`$optical-service-create-input.service-id`' />
+ </set>
+ <set>
+ <parameter name='domain-requests' value="`$service1-request-id`" />
+ <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='optical-service-create-input.payload.service-name' value="`$optical-service-create-input.payload.service-name + '_' + 'MDONS-OTN'`" />
+ </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="`'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>
+ <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>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </call>
</block>
</outcome>
- <outcome value='TAPI'>
- <block atomic='true'>
- <call module='optical-service' rpc='service-create-tapi' mode='sync' ></call>
+ <outcome value='false'>
+ <block>
+ <set>
+ <parameter name='as-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`" />
+ </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`"/>
+ </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>
</switch>
diff --git a/platform-logic/optical-service/src/main/xml/optical-service_service-create-tapi.xml b/platform-logic/optical-service/src/main/xml/optical-service_service-create-tapi.xml index f35446d8..11b729e0 100644 --- a/platform-logic/optical-service/src/main/xml/optical-service_service-create-tapi.xml +++ b/platform-logic/optical-service/src/main/xml/optical-service_service-create-tapi.xml @@ -353,7 +353,7 @@ pfx='zend' local-only='false'></get-resource> <block atomic='true'>
<return status='failure'>
<parameter name='error-code' value='500' />
- <parameter name='error-message' value='Service creation failed' />
+ <parameter name='error-message' value="`'Service creation failed for'+ ':' + $optical-service-create-input.payload.service-name`" />
<parameter name='ack-final-indicator' value="Y" />
</return>
</block>
@@ -393,11 +393,9 @@ force='true' pfx='save-result'></save> <parameter name="relationship-list.relationship[1].relationship-data[0].relationship-key" value="pnf.pnf-name" />
<parameter name="relationship-list.relationship[1].relationship-data[0].relationship-value" value="`$zend-node-uuid`" />
</save>
- <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>
+ <set>
+ <parameter name='final-response-code' value="200" />
+ </set>
</block>
</outcome>
</execute>
|