diff options
author | Mehreen Kaleem <mehreen.kaleem@us.fujitsu.com> | 2020-03-02 06:35:43 +0000 |
---|---|---|
committer | Mehreen Kaleem <mehreen.kaleem@us.fujitsu.com> | 2020-03-02 06:36:45 +0000 |
commit | bea938e72991786e13566d9df66b24a102442495 (patch) | |
tree | b10b02e28b4dc9a01e624f234588158381f2b426 /platform-logic/optical-service/src/main/xml | |
parent | 329b7c6477ec677507b0de33a053f887526b3d84 (diff) |
DG'S added for MDONS use case
Change-Id: Ie9570b9be519e54d43b547bcfbffc16d12b16123
Issue-ID: SDNC-928
Signed-off-by: Mehreen Kaleem <mehreen.kaleem@us.fujitsu.com>
Former-commit-id: 6493900ed7a55ff00b2f31f8802f30f54bf335ae
Diffstat (limited to 'platform-logic/optical-service/src/main/xml')
17 files changed, 3294 insertions, 0 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 new file mode 100644 index 00000000..0f3e967b --- /dev/null +++ b/platform-logic/optical-service/src/main/xml/optical-service_aai-delete-service-handling.xml @@ -0,0 +1,69 @@ +<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='aai-delete-service-handling' mode='sync'>
+ <block atomic='true'>
+ <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"/>
+ </record>
+ <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 = $output.service-instance-id'
+pfx='aai.service' local-only='false'></get-resource>
+ <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="`$aai.service.orchestration-status`"/>
+ <parameter name="field3" value="`$aai.service.relationship-list.relationship_length`"/>
+ </record>
+ <for index='idx' start='0' 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"
+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'
+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'
+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>
+ </for>
+ <delete 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 = $output.service-instance-id'></delete>
+ <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource="SQL"
+ key="DELETE FROM REQUEST_DETAILS WHERE request_id = $request-id"></delete>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/platform-logic/optical-service/src/main/xml/optical-service_bandwidth-update-odu1.xml b/platform-logic/optical-service/src/main/xml/optical-service_bandwidth-update-odu1.xml new file mode 100644 index 00000000..5ea2571e --- /dev/null +++ b/platform-logic/optical-service/src/main/xml/optical-service_bandwidth-update-odu1.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='optical-service' version='${project.version}'>
+ <method rpc='bandwidth-update-odu1' mode='sync'>
+ <block atomic="true">
+ <switch test='`$optical-service-create-input.payload.service-rate`'>
+ <outcome value='ODU0'>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='odu-name' value='`pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='mul' value='`$odu-number * 1.25`' />
+ <parameter name='sub' value='`$mul - 1.25`' />
+ <parameter name='new-odu-number' value='`$sub / 1.25`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='ODU1'>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='odu-name' value='`pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/platform-logic/optical-service/src/main/xml/optical-service_bandwidth-update-odu2.xml b/platform-logic/optical-service/src/main/xml/optical-service_bandwidth-update-odu2.xml new file mode 100644 index 00000000..60ed0a47 --- /dev/null +++ b/platform-logic/optical-service/src/main/xml/optical-service_bandwidth-update-odu2.xml @@ -0,0 +1,205 @@ +<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='bandwidth-update-odu2' mode='sync'>
+ <block atomic="true">
+ <switch test='`$optical-service-create-input.payload.service-rate`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='' />
+ </set>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='odu-name' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='`$new-rate + $odu-number * 1.25 - 1.25 `' />
+ <parameter name='new-odu-number' value='`$new-rate / 1.25`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 2.5`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='' />
+ </set>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='odu-name' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='`$new-rate + $odu-number * 1.5 - 2.5`' />
+ <parameter name='new-odu-number' value='`$new-rate / 1.25`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 2.5`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='odu-name' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/platform-logic/optical-service/src/main/xml/optical-service_bandwidth-update-odu3.xml b/platform-logic/optical-service/src/main/xml/optical-service_bandwidth-update-odu3.xml new file mode 100644 index 00000000..b527056c --- /dev/null +++ b/platform-logic/optical-service/src/main/xml/optical-service_bandwidth-update-odu3.xml @@ -0,0 +1,340 @@ +<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='bandwidth-update-odu3' mode='sync'>
+ <block atomic="true">
+ <switch test='`$optical-service-create-input.payload.service-rate`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='' />
+ </set>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='odu-name' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='`$new-rate + $odu-number * 1.25 - 1.25 `' />
+ <parameter name='new-odu-number' value='`$new-rate / 1.25`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 2.5`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 10`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU3'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='' />
+ </set>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='odu-name' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='`$new-rate + $odu-number * 1.25 - 2.25 `' />
+ <parameter name='new-odu-number' value='`$new-rate / 1.25`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 2.5`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 10`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU3'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='' />
+ </set>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='odu-name' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='`$new-rate + $odu-number * 1.25 - 2.25 `' />
+ <parameter name='new-odu-number' value='`$new-rate / 1.25`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 2.5`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 10`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU3'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='ODU3'>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='odu-name' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $aend-pnf-name AND
+ p-interface.interface-name = $aend-nep AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $aend-pnf-name AND
+ p-interface.interface-name = $aend-nep AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $aend-pnf-name AND
+ p-interface.interface-name = $aend-nep AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU3'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $aend-pnf-name AND
+ p-interface.interface-name = $aend-nep AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/platform-logic/optical-service/src/main/xml/optical-service_bandwidth-update-odu4.xml b/platform-logic/optical-service/src/main/xml/optical-service_bandwidth-update-odu4.xml new file mode 100644 index 00000000..1847f769 --- /dev/null +++ b/platform-logic/optical-service/src/main/xml/optical-service_bandwidth-update-odu4.xml @@ -0,0 +1,509 @@ +<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='bandwidth-update-odu4' mode='sync'>
+ <block atomic="true">
+ <switch test='`$optical-service-create-input.payload.service-rate`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='' />
+ </set>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='odu-name' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='`$new-rate + $odu-number * 1.25 - 1.25 `' />
+ <parameter name='new-odu-number' value='`$new-rate / 1.25`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 2.5`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 10`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU3'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 40`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU4'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='' />
+ </set>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='odu-name' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='`$new-rate + $odu-number * 1.25 - 2.5 `' />
+ <parameter name='new-odu-number' value='`$new-rate / 1.25`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 2.5`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 10`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU3'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 40`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU4'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='' />
+ </set>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='odu-name' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='`$new-rate + $odu-number * 1.25 - 10 `' />
+ <parameter name='new-odu-number' value='`$new-rate / 1.25`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 2.5`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 10`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU3'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 40`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU4'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='ODU3'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='' />
+ </set>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='odu-name' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='`$new-rate + $odu-number * 1.25 - 40 `' />
+ <parameter name='new-odu-number' value='`$new-rate / 1.25`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 2.5`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 10`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU3'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 40`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU4'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='ODU4'>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='odu-name' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU3'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU4'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/platform-logic/optical-service/src/main/xml/optical-service_bandwidth-update.xml b/platform-logic/optical-service/src/main/xml/optical-service_bandwidth-update.xml new file mode 100644 index 00000000..d46ca2ef --- /dev/null +++ b/platform-logic/optical-service/src/main/xml/optical-service_bandwidth-update.xml @@ -0,0 +1,90 @@ +<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='bandwidth-update' mode='sync'>
+ <block atomic="true">
+ <switch test='`$pin.speed-value`'>
+ <outcome value='ODU0'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/service-create-tapi.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Inside bandwidth odu0 calculation"/>
+ </record>
+ <switch test='`$optical-service-create-input.payload.service-rate`'>
+ <outcome value='ODU0'>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <block>
+ <set>
+ <parameter name='odu-name' value='`pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`0`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/service-create-tapi.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Inside bandwidth odu1 calculation"/>
+ </record>
+ <call module='optical-service' rpc='bandwidth-update-odu1' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/service-create-tapi.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Inside bandwidth odu2 calculation"/>
+ </record>
+ <call module='optical-service' rpc='bandwidth-update-odu2' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='ODU3'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/service-create-tapi.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Inside bandwidth odu3 calculation"/>
+ </record>
+ <call module='optical-service' rpc='bandwidth-update-odu3' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='ODU4'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/service-create-tapi.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Inside bandwidth odu4 calculation"/>
+ </record>
+ <call module='optical-service' rpc='bandwidth-update-odu4' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/platform-logic/optical-service/src/main/xml/optical-service_call-bandwidth-update-pinterface.xml b/platform-logic/optical-service/src/main/xml/optical-service_call-bandwidth-update-pinterface.xml new file mode 100644 index 00000000..1a39aa6b --- /dev/null +++ b/platform-logic/optical-service/src/main/xml/optical-service_call-bandwidth-update-pinterface.xml @@ -0,0 +1,47 @@ +<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='call-bandwidth-update-pinterface' mode='sync'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/test.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="`$div`"/>
+ </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 AND depth = 'all'"
+pfx='pin' local-only='false'></get-resource>
+ <switch test='`$pin.network-interface-type`'>
+ <outcome value='Other'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/service-create-tapi.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Port is NNI"/>
+ </record>
+ <call module='optical-service' rpc='bandwidth-update' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='UNI'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/service-create-tapi.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Port is UNI"/>
+ </record>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name'
+ local-only='false'>
+ <parameter name='available-capacity' value='0' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file 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 new file mode 100644 index 00000000..db55f387 --- /dev/null +++ b/platform-logic/optical-service/src/main/xml/optical-service_create-service-async.xml @@ -0,0 +1,72 @@ +<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-async' mode='sync'>
+ <block atomic='true'>
+ <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 Create Service Async"/>
+ </record>
+ <switch test='`$response-code`'>
+ <outcome value='200'>
+ <block atomic='true'>
+ <set>
+ <parameter name='response-message' value='SUCCESS' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+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 = $output.service-instance-id'
+ local-only='false'>
+ <parameter name='orchestration-status' value='CREATED' />
+ </update>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+resource='SQL'
+key='UPDATE REQUEST_DETAILS SET status = "CREATED" WHERE request_id = $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"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name='response-message' value='FAILURE' />
+ </set>
+ <call module='optical-service' rpc='aai-delete-service-handling' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ <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="restapiPassword" value="`$prop.so.password`"/>
+ <parameter name="httpMethod" value="POST"/>
+ <parameter name="responsePrefix" value="so-response"/>
+ <parameter name='contentType' value='application/json' />
+ <parameter name='format' value='json' />
+ <outcome value='failure'>
+ <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="Send to SO fails for service create"/>
+ </record>
+ </outcome>
+ <outcome value='success'>
+ <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="Send to SO Success for service create"/>
+ </record>
+ </outcome>
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/platform-logic/optical-service/src/main/xml/optical-service_delete-bandwidth-update-odu1.xml b/platform-logic/optical-service/src/main/xml/optical-service_delete-bandwidth-update-odu1.xml new file mode 100644 index 00000000..a3ca82ba --- /dev/null +++ b/platform-logic/optical-service/src/main/xml/optical-service_delete-bandwidth-update-odu1.xml @@ -0,0 +1,103 @@ +<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='delete-bandwidth-update-odu1' mode='sync'>
+ <block atomic="true">
+ <switch test='`$optical-service-create-input.payload.service-rate`'>
+ <outcome value='ODU0'>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='new-rate' value='' />
+ </set>
+ <set>
+ <parameter name='odu-name' value='`pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='mul' value='`$odu-number * 1.25`' />
+ <parameter name='add' value='`$new-rate + $mul + 1.25`' />
+ <parameter name='new-odu-number' value='`$add / 1.25`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 2.5`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='ODU1'>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='odu-name' value='`pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='1' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/platform-logic/optical-service/src/main/xml/optical-service_delete-bandwidth-update-odu2.xml b/platform-logic/optical-service/src/main/xml/optical-service_delete-bandwidth-update-odu2.xml new file mode 100644 index 00000000..0841388f --- /dev/null +++ b/platform-logic/optical-service/src/main/xml/optical-service_delete-bandwidth-update-odu2.xml @@ -0,0 +1,205 @@ +<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='delete-bandwidth-update-odu2' mode='sync'>
+ <block atomic="true">
+ <switch test='`$optical-service-create-input.payload.service-rate`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='' />
+ </set>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='odu-name' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='`$new-rate + $odu-number * 1.25 + 1.25 `' />
+ <parameter name='new-odu-number' value='`$new-rate / 1.25`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 2.5`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='' />
+ </set>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='odu-name' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='`$new-rate + $odu-number * 1.5 + 2.5`' />
+ <parameter name='new-odu-number' value='`$new-rate / 1.25`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 2.5`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 10`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='odu-name' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='0' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='1' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/platform-logic/optical-service/src/main/xml/optical-service_delete-bandwidth-update-odu3.xml b/platform-logic/optical-service/src/main/xml/optical-service_delete-bandwidth-update-odu3.xml new file mode 100644 index 00000000..6ae20655 --- /dev/null +++ b/platform-logic/optical-service/src/main/xml/optical-service_delete-bandwidth-update-odu3.xml @@ -0,0 +1,340 @@ +<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='delete-bandwidth-update-odu3' mode='sync'>
+ <block atomic="true">
+ <switch test='`$optical-service-create-input.payload.service-rate`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='' />
+ </set>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='odu-name' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='`$new-rate + $odu-number * 1.25 + 1.25 `' />
+ <parameter name='new-odu-number' value='`$new-rate / 1.25`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 2.5`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 10`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU3'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 40`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='' />
+ </set>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='odu-name' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='`$new-rate + $odu-number * 1.25 + 2.25 `' />
+ <parameter name='new-odu-number' value='`$new-rate / 1.25`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 2.5`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 10`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU3'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 40`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='' />
+ </set>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='odu-name' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='`$new-rate + $odu-number * 1.25 + 10 `' />
+ <parameter name='new-odu-number' value='`$new-rate / 1.25`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 2.5`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 10`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU3'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 40`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='ODU3'>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='odu-name' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='32' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $aend-pnf-name AND
+ p-interface.interface-name = $aend-nep AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='16' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $aend-pnf-name AND
+ p-interface.interface-name = $aend-nep AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='4' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $aend-pnf-name AND
+ p-interface.interface-name = $aend-nep AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU3'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='1' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $aend-pnf-name AND
+ p-interface.interface-name = $aend-nep AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/platform-logic/optical-service/src/main/xml/optical-service_delete-bandwidth-update-odu4.xml b/platform-logic/optical-service/src/main/xml/optical-service_delete-bandwidth-update-odu4.xml new file mode 100644 index 00000000..d73a89db --- /dev/null +++ b/platform-logic/optical-service/src/main/xml/optical-service_delete-bandwidth-update-odu4.xml @@ -0,0 +1,509 @@ +<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='delete-bandwidth-update-odu4' mode='sync'>
+ <block atomic="true">
+ <switch test='`$optical-service-create-input.payload.service-rate`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='' />
+ </set>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='odu-name' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='`$new-rate + $odu-number * 1.25 + 1.25 `' />
+ <parameter name='new-odu-number' value='`$new-rate / 1.25`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 2.5`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 10`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU3'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 40`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU4'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 100`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='' />
+ </set>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='odu-name' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='`$new-rate + $odu-number * 1.25 + 2.5 `' />
+ <parameter name='new-odu-number' value='`$new-rate / 1.25`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 2.5`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 10`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU3'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 40`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU4'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 100`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='' />
+ </set>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='odu-name' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='`$new-rate + $odu-number * 1.25 + 10 `' />
+ <parameter name='new-odu-number' value='`$new-rate / 1.25`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 2.5`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 10`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU3'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 40`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU4'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 100`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='ODU3'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='' />
+ </set>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='odu-name' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-rate' value='`$new-rate + $odu-number * 1.25 + 40 `' />
+ <parameter name='new-odu-number' value='`$new-rate / 1.25`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 2.5`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 10`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU3'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 40`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU4'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='`$new-rate / 100`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='ODU4'>
+ <for index='idx' start='0' end='pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth_length' >
+ <set>
+ <parameter name='odu-name' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].odu-type`' />
+ <parameter name='odu-number' value='`$pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[$idx].number`' />
+ </set>
+ <switch test='`$odu-name`'>
+ <outcome value='ODU0'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='80' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU1'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='40' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU2'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='10' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU3'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='2' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ <outcome value='ODU4'>
+ <block>
+ <set>
+ <parameter name='new-odu-number' value='1' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+resource='available-bandwidth'
+ key='pnf.pnf-name = $pnf-name AND
+ p-interface.interface-name = $pinterface-name AND
+ bandwidth-attribute.id = $pin.bandwidth-attributes.bandwidth-attribute[0].id AND
+ available-bandwidth.id = $pin.bandwidth-attributes.bandwidth-attribute[0].available-bandwidth-map.available-bandwidth[0].id'
+ local-only='false'>
+ <parameter name='number' value='`$new-odu-number`' />
+ </update>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/platform-logic/optical-service/src/main/xml/optical-service_delete-service-async.xml b/platform-logic/optical-service/src/main/xml/optical-service_delete-service-async.xml new file mode 100644 index 00000000..f00f00ce --- /dev/null +++ b/platform-logic/optical-service/src/main/xml/optical-service_delete-service-async.xml @@ -0,0 +1,67 @@ +<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='delete-service-async' mode='sync'>
+ <block atomic='true'>
+ <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 Delete Service Async"/>
+ </record>
+ <switch test='`$response-code`'>
+ <outcome value='200'>
+ <block atomic='true'>
+ <set>
+ <parameter name='response-message' value='SUCCESS' />
+ </set>
+ <call module='optical-service' rpc='aai-delete-service-handling' mode='sync' ></call>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name='response-message' value='FAILURE' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
+force='true'
+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 = $output.service-instance-id'
+ local-only='false'>
+ <parameter name='orchestration-status' value='CREATED' />
+ </update>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+resource='SQL'
+key='UPDATE REQUEST_DETAILS SET status = "CREATED" WHERE request_id = $request-id'
+force='true' pfx='save-result'></save>
+ </block>
+ </outcome>
+ </switch>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/async-response-so.json'`" />
+ <parameter name="restapiUrl" value="`$output.notification-url`"/>
+ <parameter name="restapiUser" value="`$prop.so.username`" />
+ <parameter name="restapiPassword" value="`$prop.so.password`"/>
+ <parameter name="httpMethod" value="POST"/>
+ <parameter name="responsePrefix" value="so-response"/>
+ <parameter name='contentType' value='application/json' />
+ <parameter name='format' value='json' />
+ <outcome value='failure'>
+ <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="Send to SO fails for service delete"/>
+ </record>
+ </outcome>
+ <outcome value='success'>
+ <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="Send to SO fails for service delete"/>
+ </record>
+ </outcome>
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/platform-logic/optical-service/src/main/xml/optical-service_handle-async-notif.xml b/platform-logic/optical-service/src/main/xml/optical-service_handle-async-notif.xml new file mode 100644 index 00000000..bcae1f4f --- /dev/null +++ b/platform-logic/optical-service/src/main/xml/optical-service_handle-async-notif.xml @@ -0,0 +1,44 @@ +<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='handle-async-notif' mode='sync'>
+ <block atomic='true'>
+ <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="Reached async graph"/>
+ <parameter name="field2" value="`$request-id`"/>
+ </record>
+ <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>
+ <switch test='`$ack-final-indicator`'>
+ <outcome value='N'>
+ <block atomic='true'>
+ <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="Ack indicator in 'N'"/>
+ </record>
+ </block>
+ </outcome>
+ <outcome value='Y'>
+ <block atomic='true'>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+key='SELECT * from REQUEST_DETAILS WHERE request_id = $request-id '
+pfx='output'></get-resource>
+ <switch test='`$output.status`'>
+ <outcome value='CREATING'>
+ <call module='optical-service' rpc='create-service-async' mode='sync' ></call>
+ </outcome>
+ <outcome value='DELETING'>
+ <call module='optical-service' rpc='delete-service-async' mode='sync' ></call>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file 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 new file mode 100644 index 00000000..f35446d8 --- /dev/null +++ b/platform-logic/optical-service/src/main/xml/optical-service_service-create-tapi.xml @@ -0,0 +1,406 @@ +<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='service-create-tapi' mode='sync'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/service-create-tapi.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Inside optical service create tapi"/>
+ </record>
+ <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 = $optical-service-create-input.payload.service-aend.port-id'
+pfx='db-aend'>
+ <outcome value='success'>
+ <set>
+ <parameter name='aend-node-uuid' value='`$db-aend.pnf-name`' />
+ <parameter name='aend-pnf-name' value='`$db-aend.pnf-id`' />
+ <parameter name='aend-cep-list' value='`$db-aend.connection-point`' />
+ <parameter name='aend-nep' value='`$db-aend.interface-name`' />
+ <parameter name='aend-rate' value='`$db-aend.rate`' />
+ </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'
+pfx='db-zend'>
+ <outcome value='success'>
+ <set>
+ <parameter name='zend-node-uuid' value='`$db-zend.pnf-name`' />
+ <parameter name='zend-pnf-name' value='`$db-zend.pnf-id`' />
+ <parameter name='zend-cep-list' value='`$db-zend.connection-point`' />
+ <parameter name='zend-nep' value='`$db-zend.interface-name`' />
+ <parameter name='zend-rate' value='`$db-zend.rate`' />
+ </set>
+ </outcome>
+ </get-resource>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+resource="p-interface"
+ key="pnf.pnf-name = $aend-node-uuid AND
+ p-interface.interface-name = $aend-nep"
+pfx='aend' local-only='false'></get-resource>
+ <switch test='`$aend.network-interface-type`'>
+ <outcome value='UNI'>
+ <block atomic='true'>
+ <set>
+ <parameter name='aend-cep' value='`$aend-cep-list`' />
+ <parameter name='aend-new' value='' />
+ <parameter name='aend-new-rate' value='0' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/service-create-tapi.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Aend uni"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="restapiUrl" value="` $controller-ip + $prop.tapi.cep.details.url + $aend-cep`" />
+ <parameter name="restapiUser" value="admin"/>
+ <parameter name="restapiPassword" value="admin"/>
+ <parameter name="httpMethod" value="GET"/>
+ <parameter name="responsePrefix" value="aend-cep-response"/>
+ <parameter name='contentType' value='application/json' />
+ <parameter name='format' value='json' />
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.tapi.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <outcome value='failure'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/service-create-tapi.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Failed to get Aend cep details"/>
+ </record>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='aend-local-id' value="`'/OTN/' + $aend-pnf-name + '/' + $aend-cep-response.sip[0].name[2].value + ':' + $aend-cep-response.sip[0].name[1].value`" />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name='aend-new' value='' />
+ <parameter name='aend-local-id' value='' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value='`$aend-cep-list`'/>
+ <parameter name="regex" value=","/>
+ <parameter name="ctx_memory_result_key" value="param-prefix"/>
+ </execute>
+ <for index='idx' start='0' end='`$param-prefix_length`' >
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="restapiUrl" value="` $controller-ip + $prop.tapi.cep.details.url + $param-prefix[$idx]`" />
+ <parameter name="restapiUser" value="admin"/>
+ <parameter name="restapiPassword" value="admin"/>
+ <parameter name="httpMethod" value="GET"/>
+ <parameter name="responsePrefix" value="aend-cep-response"/>
+ <parameter name='contentType' value='application/json' />
+ <parameter name='format' value='json' />
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.tapi.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <outcome value='failure'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/service-create-tapi.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Failed to get Aend cep details"/>
+ </record>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/service-create-tapi.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Sucessfully retrieved aend cep"/>
+ </record>
+ <switch test='`$aend-cep-response.sip[0].name[2].value == $optical-service-create-input.payload.service-rate`'>
+ <outcome value='true'>
+ <block atomic='true'>
+ <set>
+ <parameter name='aend-local-id' value="`$aend-local-id + '/OTN/' + $aend-pnf-name + '/' + $aend-cep-response.sip[0].name[2].value + ':' + $aend-cep-response.sip[0].name[1].value`" />
+ <parameter name='aend-cep' value='`$param-prefix[$idx]`'/>
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='No service interface points could be found for A end ' />
+ <parameter name='ack-final-indicator' value="Y" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </for>
+ <switch test='`$param-prefix_length == 1`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='zend-new' value="`$zend-new`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <for index='idy' start='0' end='`$param-prefix_length`' >
+ <switch test='`$idy`'>
+ <outcome value='`$param-prefix_length - 1`'>
+ <set>
+ <parameter name='aend-new' value="`$aend-new + $param-prefix[$idy]`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='aend-new' value="`$aend-new + $param-prefix[$idy] + ','`" />
+ </set>
+ </outcome>
+ <outcome value='`$idx`'>
+ <set>
+ <parameter name='aend-new' value='`$aend-new`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+resource="p-interface"
+ key="pnf.pnf-name = $zend-node-uuid AND
+ p-interface.interface-name = $zend-nep"
+pfx='zend' local-only='false'></get-resource>
+ <switch test='`$zend.network-interface-type`'>
+ <outcome value='UNI'>
+ <block atomic='true'>
+ <set>
+ <parameter name='zend-cep' value='`$zend-cep-list`' />
+ <parameter name='zend-new' value='' />
+ <parameter name='zend-new-rate' value='0' />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/service-create-tapi.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Zend uni"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="restapiUrl" value="` $controller-ip + $prop.tapi.cep.details.url + $zend-cep`" />
+ <parameter name="restapiUser" value="admin"/>
+ <parameter name="restapiPassword" value="admin"/>
+ <parameter name="httpMethod" value="GET"/>
+ <parameter name="responsePrefix" value="zend-cep-response"/>
+ <parameter name='contentType' value='application/json' />
+ <parameter name='format' value='json' />
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.tapi.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <outcome value='failure'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/service-create-tapi.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Failed to get Aend cep details"/>
+ </record>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <set>
+ <parameter name='zend-local-id' value="`'/OTN/' + $zend-pnf-name + '/' + $zend-cep-response.sip[0].name[2].value + ':' + $zend-cep-response.sip[0].name[1].value`" />
+ </set>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic='true'>
+ <set>
+ <parameter name='zend-new' value='' />
+ <parameter name='zend-local-id' value='' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value='`$zend-cep-list`'/>
+ <parameter name="regex" value=","/>
+ <parameter name="ctx_memory_result_key" value="param-prefix1"/>
+ </execute>
+ <for index='idk' start='0' end='`$param-prefix1_length`' >
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="restapiUrl" value="` $controller-ip + $prop.tapi.cep.details.url + $param-prefix1[$idk]`" />
+ <parameter name="restapiUser" value="admin"/>
+ <parameter name="restapiPassword" value="admin"/>
+ <parameter name="httpMethod" value="GET"/>
+ <parameter name="responsePrefix" value="zend-cep-response"/>
+ <parameter name='contentType' value='application/json' />
+ <parameter name='format' value='json' />
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.tapi.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <outcome value='failure'>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/service-create-tapi.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Failed to get zend cep details"/>
+ </record>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/service-create-tapi.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Sucessfully retrieved zend cep"/>
+ </record>
+ <switch test='`$zend-cep-response.sip[0].name[2].value == $optical-service-create-input.payload.service-rate`'>
+ <outcome value='true'>
+ <block>
+ <set>
+ <parameter name='zend-local-id' value="`$zend-local-id + '/OTN/' + $zend-pnf-name + '/' + $zend-cep-response.sip[0].name[2].value + ':' + $zend-cep-response.sip[0].name[1].value`" />
+ <parameter name='zend-cep' value='`$param-prefix1[$idk]`'/>
+ </set>
+ <break/>
+ </block>
+ </outcome>
+ <outcome value='false'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='No service interface points could be found for Z end ' />
+ <parameter name='ack-final-indicator' value="Y" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </for>
+ <switch test='`$param-prefix1_length == 1`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='zend-new' value="`$zend-new`" />
+ </set>
+ </outcome>
+ <outcome value='false'>
+ <for index='idl' start='0' end='`$param-prefix1_length`' >
+ <switch test='`$idl`'>
+ <outcome value='`$param-prefix1_length - 1`'>
+ <set>
+ <parameter name='zend-new' value="`$zend-new + $param-prefix1[$idl]`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='zend-new' value="`$zend-new + $param-prefix1[$idl] + ','`" />
+ </set>
+ </outcome>
+ <outcome value='`$idk`'>
+ <set>
+ <parameter name='zend-new' value='`$zend-new`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-name' value="`$optical-service-create-input.payload.service-name`" />
+ <parameter name='svc-action' value="CREATE" />
+ </set>
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/service-create-tapi.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="A end local-id"/>
+ <parameter name="field2" value="`$aend-local-id`"/>
+ <parameter name="field3" value="Z end local-id"/>
+ <parameter name="field4" value="`$zend-local-id`"/>
+ <parameter name="field5" value="Service name"/>
+ <parameter name="field6" value="`$service-name`"/>
+ </record>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/optical-service-create-tapi.json'`" />
+ <parameter name="restapiUrl" value="`$controller-ip + '/cxf/tapi/v2/connectivities/tapi-services'`"/>
+ <parameter name="restapiUser" value="admin"/>
+ <parameter name="restapiPassword" value="admin"/>
+ <parameter name="httpMethod" value="POST"/>
+ <parameter name="responsePrefix" value="tapi-service-response"/>
+ <parameter name='contentType' value='application/json' />
+ <parameter name='format' value='json' />
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.tapi.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <outcome value='failure'>
+ <block atomic='true'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Service creation failed' />
+ <parameter name='ack-final-indicator' value="Y" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <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 , null );"></save>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+resource='SQL'
+key='UPDATE TOPOLOGY_LOGICAL_RELATION_TO_PINTERFACE SET connection_point = $aend-new WHERE interface_name = $aend-nep'
+force='true' pfx='save-result'></save>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+resource='SQL'
+key='UPDATE TOPOLOGY_LOGICAL_RELATION_TO_PINTERFACE SET connection_point = $zend-new WHERE interface_name = $zend-nep'
+force='true' pfx='save-result'></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
+ service-instance.service-instance-id = $optical-service-create-input.service-id' >
+ <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='service-rate' value='`$optical-service-create-input.payload.service-rate`' />
+ <parameter name='service-layer' value='ODU' />
+ </save>
+ <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 = $optical-service-create-input.service-id' force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="p-interface" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`'/network/pnfs/pnf/' + $aend-node-uuid + '/p-interfaces/p-interface/' + $optical-service-create-input.payload.service-aend.port-id `" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="pnf.pnf-name" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$aend-node-uuid`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="p-interface" />
+ <parameter name="relationship-list.relationship[1].related-link" value="`'/network/pnfs/pnf/' + $zend-node-uuid + '/p-interfaces/p-interface/' + $optical-service-create-input.payload.service-zend.port-id `" />
+ <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>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file 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 new file mode 100644 index 00000000..919c5548 --- /dev/null +++ b/platform-logic/optical-service/src/main/xml/optical-service_service-delete-tapi.xml @@ -0,0 +1,152 @@ +<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='service-delete-tapi' mode='sync'>
+ <block atomic="true">
+ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/service-create-tapi.log" />
+ <parameter name="level" value="info" />
+ <parameter name="field1" value="Inside optical service delete tapi"/>
+ </record>
+ <set>
+ <parameter name='request-id' value='`$optical-service-delete-input.request-id`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="restapiUrl" value="` $controller-ip + $prop.tapi.get.services.url + $optical-service-delete-input.payload.service-name`" />
+ <parameter name="restapiUser" value="admin"/>
+ <parameter name="restapiPassword" value="admin"/>
+ <parameter name="httpMethod" value="GET"/>
+ <parameter name="responsePrefix" value="services-response"/>
+ <parameter name='contentType' value='application/json' />
+ <parameter name='format' value='json' />
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.tapi.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <outcome value='failure'></outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <set>
+ <parameter name='aend-nep' value="`$services-response.service[0].end-point[0].connection-end-point[0].node-edge-point-uuid`" />
+ <parameter name='zend-nep' value="`$services-response.service[0].end-point[1].connection-end-point[0].node-edge-point-uuid`" />
+ <parameter name='aend-cep' value="`$services-response.service[0].end-point[0].connection-end-point[0].connection-end-point-uuid`" />
+ <parameter name='zend-cep' value="`$services-response.service[0].end-point[1].connection-end-point[0].connection-end-point-uuid`" />
+ </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 = $aend-nep'
+pfx='db-aend'></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 = $zend-nep'
+pfx='db-zend'></get-resource>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="restapiUrl" value="` $controller-ip + $prop.tapi.delete.service.url + $optical-service-delete-input.payload.service-name`" />
+ <parameter name="restapiUser" value="admin"/>
+ <parameter name="restapiPassword" value="admin"/>
+ <parameter name="httpMethod" value="DELETE"/>
+ <parameter name="responsePrefix" value="tapi-service-response"/>
+ <parameter name='contentType' value='application/json' />
+ <parameter name='format' value='json' />
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.tapi.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <outcome value='failure'>
+ <block atomic='true'>
+ <return status='failure'>
+ <parameter name='error-code' value='500' />
+ <parameter name='error-message' value='Service Deletion failed' />
+ <parameter name='ack-final-indicator' value="Y" />
+ </return>
+ </block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+resource="p-interface"
+ key="pnf.pnf-name = $db-aend.pnf-name AND
+ p-interface.interface-name = $aend-nep"
+pfx='aend' local-only='false'></get-resource>
+ <switch test='`$aend.network-interface-type`'>
+ <outcome value='UNI'>
+ <set>
+ <parameter name='aend-new' value='`$aend-cep`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$db-aend.connection-point`'>
+ <outcome value=''>
+ <set>
+ <parameter name='aend-new' value="`$aend-cep`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='aend-new' value="`$db-aend.connection-point + ',' + $aend-cep`" />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+resource='SQL'
+key='UPDATE TOPOLOGY_LOGICAL_RELATION_TO_PINTERFACE SET connection_point = $aend-new WHERE interface_name = $aend-nep'
+force='true' pfx='save-result'></save>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+resource="p-interface"
+ key="pnf.pnf-name = $db-zend.pnf-name AND
+ p-interface.interface-name = $zend-nep"
+pfx='zend' local-only='false'></get-resource>
+ <switch test='`$zend.network-interface-type`'>
+ <outcome value='UNI'>
+ <set>
+ <parameter name='zend-new' value='`$zend-cep`' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <switch test='`$db-zend.connection-point`'>
+ <outcome value=''>
+ <set>
+ <parameter name='zend-new' value="`$zend-cep`" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='zend-new' value="`$db-zend.connection-point + ',' + $zend-cep`" />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+resource='SQL'
+key='UPDATE TOPOLOGY_LOGICAL_RELATION_TO_PINTERFACE SET connection_point = $zend-new WHERE interface_name = $zend-nep'
+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 request_id = $request-id '
+pfx='output'></get-resource>
+ <delete 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 = $output.service-instance-id'></delete>
+ <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
+ resource="SQL"
+ key="DELETE FROM REQUEST_DETAILS WHERE request_id = $request-id"></delete>
+ <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>
+ </execute>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/platform-logic/optical-service/src/main/xml/optical-service_success-aai-update-tapi.xml b/platform-logic/optical-service/src/main/xml/optical-service_success-aai-update-tapi.xml new file mode 100644 index 00000000..c3b9639b --- /dev/null +++ b/platform-logic/optical-service/src/main/xml/optical-service_success-aai-update-tapi.xml @@ -0,0 +1,36 @@ +<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='success-aai-update-tapi' mode='sync'>
+ <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 = $optical-service-create-input.service-id' force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="p-interface" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`'/network/pnfs/pnf/' + $aend-node-uuid + '/p-interfaces/p-interface/' + $aend-nep `" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="pnf.pnf-name" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$aend-node-uuid`" />
+ <parameter name="relationship-list.relationship[1].related-to" value="p-interface" />
+ <parameter name="relationship-list.relationship[1].related-link" value="`'/network/pnfs/pnf/' + $zend-node-uuid + '/p-interfaces/p-interface/' + $zend-nep `" />
+ <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>
+ <get-resource 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
+ service-instance.service-instance-id = $optical-service-create-input.service-id'
+pfx='aai.service' local-only='false'></get-resource>
+ <for index='idy' start='0' 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>
+ <call module='optical-service' rpc='call-bandwidth-update-pinterface' mode='sync' ></call>
+ </block>
+ </for>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file |