diff options
Diffstat (limited to 'platform-logic/generic-resource-api/src/main/xml')
5 files changed, 1005 insertions, 401 deletions
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation.xml index 05328d29..f2e71fad 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation.xml @@ -1,420 +1,443 @@ -<service-logic - xmlns='http://www.onap.org/sdnc/svclogic' - xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> - <method rpc='network-topology-operation' mode='sync'> - <block atomic="true"> - <call module='GENERIC-RESOURCE-API' rpc='validate-network-input' mode='sync' ></call> - <switch test='`$network-topology-operation-input.sdnc-request-header.svc-action`'> - <outcome value='assign'> - <block atomic="true"> - <switch test='`$service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`'> - <outcome value='Created'> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="`'Network is not in appropriate state for assign. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`" /> - </return> - </outcome> - <outcome value='PendingDelete'> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="`'Network is not in appropriate state for assign. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`" /> - </return> - </outcome> - <outcome value='PendingCreate'> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="`'Network is not in appropriate state for assign. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`" /> - </return> +<?xml version="1.0" encoding="utf-8"?> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module="GENERIC-RESOURCE-API" version="${project.version}"> + <method rpc="network-topology-operation" mode="sync"> + <block atomic="true"> + <call module="GENERIC-RESOURCE-API" rpc="validate-network-input" mode="sync"></call> + <switch test="`$network-topology-operation-input.sdnc-request-header.svc-action`"> + <outcome value="assign"> + <block atomic="true"> + <switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`"> + <outcome value="Created"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Network is not in appropriate state for assign. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`"/> + </return> + </outcome> + <outcome value="PendingDelete"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Network is not in appropriate state for assign. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`"/> + </return> + </outcome> + <outcome value="PendingCreate"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Network is not in appropriate state for assign. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`"/> + </return> + </outcome> + <outcome value="Other"> + <call module="GENERIC-RESOURCE-API" rpc="network-topology-operation-assign" mode="sync"></call> + </outcome> + </switch> + </block> + </outcome> + <outcome value="activate"> + <switch test="`$network-topology-operation-input.request-information.request-action`"> + <outcome value="ActivateSOTNConnectivityInstance"> + <call module="GENERIC-RESOURCE-API" rpc="sotn-network-topology-operation-activate" mode="sync"></call> + </outcome> + <outcome value="ActivateDCINetworkInstance"> + <call module="GENERIC-RESOURCE-API" rpc="dci-connects-network-topology-operation-activate" mode="sync"></call> + </outcome> + <outcome value="ActivateSDWANConnectivityInstance"> + <call module="GENERIC-RESOURCE-API" rpc="sdwan-network-topology-operation-activate" mode="sync"></call> + </outcome> + <outcome value="other"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.service-information.onap-model-information.model-name`"/> + <parameter name="target" value="wan-connection"/> + <outcome value="true"> + <call module="GENERIC-RESOURCE-API" rpc="wan-connection-topology-operation-activate" mode="sync"></call> + </outcome> + <outcome value="false"> + <block atomic="true"> + <switch test="`$service-data.networks.network_length`"> + <outcome value=""> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data"/> + </return> + </outcome> + <outcome value="Other"> + <block atomic="true"> + <for index="nidx" start="0" end="`$service-data.networks.network_length`"> + <switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`"> + <outcome value="true"> + <set> + <parameter name="tmp.nidx" value="`$nidx`"/> + <parameter name="network-data." value="`$service-data.networks.network[$nidx].`"/> + </set> + </outcome> + </switch> + </for> + <switch test="`$tmp.nidx`"> + <outcome value=""> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data"/> + </return> </outcome> - <outcome value='Other'> - <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-assign' mode='sync' ></call> + <outcome value="Other"> + <set> + <parameter name="nidx" value="`$tmp.nidx`"/> + </set> </outcome> - </switch> - </block> - </outcome> - <outcome value='activate'> - <switch test='`$network-topology-operation-input.request-information.request-action`'> - <outcome value='ActivateSOTNConnectivityInstance'> - <call module='GENERIC-RESOURCE-API' rpc='sotn-network-topology-operation-activate' mode='sync' ></call> - </outcome> - <outcome value='ActivateDCINetworkInstance'> - <call module='GENERIC-RESOURCE-API' rpc='dci-connects-network-topology-operation-activate' mode='sync' ></call> - </outcome> - <outcome value='ActivateSDWANConnectivityInstance'> - <call module='GENERIC-RESOURCE-API' rpc='sdwan-network-topology-operation-activate' mode='sync' ></call> - </outcome> - <outcome value='other'> - <block atomic="true"> - <switch test='`$service-data.networks.network_length`'> - <outcome value=''> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" /> - </return> - </outcome> - <outcome value='Other'> - <block atomic="true"> - <for index='nidx' start='0' end='`$service-data.networks.network_length`' > - <switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`"> - <outcome value='true'> - <set> - <parameter name='tmp.nidx' value='`$nidx`' /> - <parameter name='network-data.' value='`$service-data.networks.network[$nidx].`' /> - </set> - </outcome> - </switch> - </for> - <switch test="`$tmp.nidx`"> - <outcome value=''> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" /> - </return> - </outcome> - <outcome value='Other'> - <set> - <parameter name='nidx' value='`$tmp.nidx`' /> - </set> - </outcome> - </switch> - </block> - </outcome> - </switch> - <switch test='`$network-topology-operation-input.network-information.network-instance-group-id`'> - <outcome value=''> - <return status='success'> - <parameter name='' value='' /> - </return> - </outcome> - <outcome value='Other'> - <block> - <switch test='`$service-data.network-instance-groups.network-instance-group_length`'> - <outcome value=''> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-instance-group-id not found in service-data" /> - </return> - </outcome> - <outcome value='Other'> - <block atomic="true"> - <for index='ngidx' start='0' end='`$service-data.network-instance-groups.network-instance-_length`' > - <switch test="`$service-data.network-instance-groups.network-instance-group[$nidx].network-instance-group-id == $network-topology-operation-input.network-information.network-instance-group-id`"> - <outcome value='true'> - <block atomic="true"> - <set> - <parameter name='tmp.ngidx' value='`$ngidx`' /> - <parameter name='ctx.network-instance-group-data.' value='`$service-data.network-instance-groups.network-instance-group[$ngidx].`' /> - </set> - </block> - </outcome> - </switch> - </for> - </block> - </outcome> - </switch> - </block> - </outcome> - </switch> - <switch test='`$service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`'> - <outcome value='PendingCreate'> - <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-activate' mode='sync' ></call> - </outcome> - <outcome value='Other'> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="`'Network is not in appropriate state for activate. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`" /> - </return> - </outcome> - </switch> - </block> - </outcome> + </switch> + </block> + </outcome> </switch> - </outcome> - <outcome value='changeassign'> - <block atomic="true"> - <switch test='`$service-data.networks.network_length`'> - <outcome value=''> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" /> - </return> + <switch test="`$network-topology-operation-input.network-information.network-instance-group-id`"> + <outcome value=""> + <return status="success"></return> + </outcome> + <outcome value="Other"> + <block> + <switch test="`$service-data.network-instance-groups.network-instance-group_length`"> + <outcome value=""> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-instance-group-id not found in service-data"/> + </return> </outcome> - <outcome value='Other'> - <block atomic="true"> - <for index='nidx' start='0' end='`$service-data.networks.network_length`' > - <switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`"> - <outcome value='true'> - <set> - <parameter name='tmp.nidx' value='`$nidx`' /> - <parameter name='network-data.' value='`$service-data.networks.network[$nidx].`' /> - </set> - </outcome> - </switch> - </for> - <switch test="`$tmp.nidx`"> - <outcome value=''> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" /> - </return> - </outcome> - <outcome value='Other'> - <set> - <parameter name='nidx' value='`$tmp.nidx`' /> - </set> - </outcome> - </switch> - </block> + <outcome value="Other"> + <block atomic="true"> + <for index="ngidx" start="0" end="`$service-data.network-instance-groups.network-instance-_length`"> + <switch test="`$service-data.network-instance-groups.network-instance-group[$nidx].network-instance-group-id == $network-topology-operation-input.network-information.network-instance-group-id`"> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="tmp.ngidx" value="`$ngidx`"/> + <parameter name="ctx.network-instance-group-data." value="`$service-data.network-instance-groups.network-instance-group[$ngidx].`"/> + </set> + </block> + </outcome> + </switch> + </for> + </block> </outcome> - </switch> - <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-changeassign' mode='sync' ></call> - </block> + </switch> + </block> + </outcome> + </switch> + <switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`"> + <outcome value="PendingCreate"> + <call module="GENERIC-RESOURCE-API" rpc="network-topology-operation-activate" mode="sync"></call> + </outcome> + <outcome value="Other"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Network is not in appropriate state for activate. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`"/> + </return> + </outcome> + </switch> + </block> </outcome> - <outcome value='deactivate'> - <switch test='`$network-topology-operation-input.request-information.request-action`'> - <outcome value='DeactivateSOTNConnectivityInstance'> - <call module='GENERIC-RESOURCE-API' rpc='sotn-network-topology-operation-deactivate' mode='sync' ></call> - </outcome> - <outcome value='DeActivateDCINetworkInstance'> - <call module='GENERIC-RESOURCE-API' rpc='dci-connects-network-topology-operation-deactivate' mode='sync' ></call> - </outcome> - <outcome value='DeactivateSDWANConnectivityInstance'> - <call module='GENERIC-RESOURCE-API' rpc='sdwan-network-topology-operation-deactivate' mode='sync' ></call> - </outcome> - <outcome value='Other'> - <block atomic="true"> - <switch test='`$service-data.networks.network_length`'> - <outcome value=''> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" /> - </return> - </outcome> - <outcome value='Other'> - <block atomic="true"> - <for index='nidx' start='0' end='`$service-data.networks.network_length`' > - <switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`"> - <outcome value='true'> - <set> - <parameter name='tmp.nidx' value='`$nidx`' /> - <parameter name='network-data.' value='`$service-data.networks.network[$nidx].`' /> - </set> - </outcome> - </switch> - </for> - <switch test="`$tmp.nidx`"> - <outcome value=''> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" /> - </return> - </outcome> - <outcome value='Other'> - <set> - <parameter name='nidx' value='`$tmp.nidx`' /> - </set> - </outcome> - </switch> - </block> - </outcome> - </switch> - <switch test='`$network-topology-operation-input.network-information.network-instance-group-id`'> - <outcome value=''> - <return status='success'> - <parameter name='' value='' /> - </return> - </outcome> - <outcome value='Other'> - <block> - <switch test='`$service-data.network-instance-groups.network-instance-group_length`'> - <outcome value=''> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-instance-group-id not found in service-data" /> - </return> - </outcome> - <outcome value='Other'> - <block atomic="true"> - <for index='ngidx' start='0' end='`$service-data.network-instance-groups.network-instance-_length`' > - <switch test="`$service-data.network-instance-groups.network-instance-group[$nidx].network-instance-group-id == $network-topology-operation-input.network-information.network-instance-group-id`"> - <outcome value='true'> - <block atomic="true"> - <set> - <parameter name='tmp.ngidx' value='`$ngidx`' /> - <parameter name='ctx.network-instance-group-data.' value='`$service-data.network-instance-groups.network-instance-group[$ngidx].`' /> - </set> - </block> - </outcome> - </switch> - </for> - </block> - </outcome> - </switch> - </block> - </outcome> - </switch> - <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-deactivate' mode='sync' ></call> - </block> - </outcome> + </execute> + </outcome> + </switch> + </outcome> + <outcome value="changeassign"> + <block atomic="true"> + <switch test="`$service-data.networks.network_length`"> + <outcome value=""> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data"/> + </return> + </outcome> + <outcome value="Other"> + <block atomic="true"> + <for index="nidx" start="0" end="`$service-data.networks.network_length`"> + <switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`"> + <outcome value="true"> + <set> + <parameter name="tmp.nidx" value="`$nidx`"/> + <parameter name="network-data." value="`$service-data.networks.network[$nidx].`"/> + </set> + </outcome> </switch> + </for> + <switch test="`$tmp.nidx`"> + <outcome value=""> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data"/> + </return> + </outcome> + <outcome value="Other"> + <set> + <parameter name="nidx" value="`$tmp.nidx`"/> + </set> + </outcome> + </switch> + </block> + </outcome> + </switch> + <call module="GENERIC-RESOURCE-API" rpc="network-topology-operation-changeassign" mode="sync"></call> + </block> + </outcome> + <outcome value="deactivate"> + <switch test="`$network-topology-operation-input.request-information.request-action`"> + <outcome value="DeactivateSOTNConnectivityInstance"> + <call module="GENERIC-RESOURCE-API" rpc="sotn-network-topology-operation-deactivate" mode="sync"></call> + </outcome> + <outcome value="DeActivateDCINetworkInstance"> + <call module="GENERIC-RESOURCE-API" rpc="dci-connects-network-topology-operation-deactivate" mode="sync"></call> + </outcome> + <outcome value="DeactivateSDWANConnectivityInstance"> + <call module="GENERIC-RESOURCE-API" rpc="sdwan-network-topology-operation-deactivate" mode="sync"></call> + </outcome> + <outcome value="Other"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.service-information.onap-model-information.model-name`"/> + <parameter name="target" value="wan-connection"/> + <outcome value="true"> + <call module="GENERIC-RESOURCE-API" rpc="wan-connection-topology-operation-deactivate" mode="sync"></call> </outcome> - <outcome value='unassign'> - <block atomic="true"> - <switch test='`$service-data.networks.network_length`'> - <outcome value=''> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" /> - </return> - </outcome> - <outcome value='Other'> - <block atomic="true"> - <for index='nidx' start='0' end='`$service-data.networks.network_length`' > - <switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`"> - <outcome value='true'> - <set> - <parameter name='tmp.nidx' value='`$nidx`' /> - <parameter name='network-data.' value='`$service-data.networks.network[$nidx].`' /> - </set> - </outcome> - </switch> - </for> - <switch test="`$tmp.nidx`"> - <outcome value=''> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" /> - </return> - </outcome> - <outcome value='Other'> - <set> - <parameter name='nidx' value='`$tmp.nidx`' /> - </set> - </outcome> - </switch> - </block> + <outcome value="false"> + <block atomic="true"> + <switch test="`$service-data.networks.network_length`"> + <outcome value=""> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data"/> + </return> + </outcome> + <outcome value="Other"> + <block atomic="true"> + <for index="nidx" start="0" end="`$service-data.networks.network_length`"> + <switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`"> + <outcome value="true"> + <set> + <parameter name="tmp.nidx" value="`$nidx`"/> + <parameter name="network-data." value="`$service-data.networks.network[$nidx].`"/> + </set> + </outcome> + </switch> + </for> + <switch test="`$tmp.nidx`"> + <outcome value=""> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data"/> + </return> </outcome> - </switch> - <switch test='`$network-topology-operation-input.network-information.network-instance-group-id`'> - <outcome value=''> - <return status='success'> - <parameter name='' value='' /> - </return> + <outcome value="Other"> + <set> + <parameter name="nidx" value="`$tmp.nidx`"/> + </set> </outcome> - <outcome value='Other'> - <block> - <switch test='`$service-data.network-instance-groups.network-instance-group_length`'> - <outcome value=''> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-instance-group-id not found in service-data" /> - </return> - </outcome> - <outcome value='Other'> - <block atomic="true"> - <for index='ngidx' start='0' end='`$service-data.network-instance-groups.network-instance-_length`' > - <switch test="`$service-data.network-instance-groups.network-instance-group[$nidx].network-instance-group-id == $network-topology-operation-input.network-information.network-instance-group-id`"> - <outcome value='true'> - <block atomic="true"> - <set> - <parameter name='tmp.ngidx' value='`$ngidx`' /> - <parameter name='ctx.network-instance-group-data.' value='`$service-data.network-instance-groups.network-instance-group[$ngidx].`' /> - </set> - </block> - </outcome> - </switch> - </for> - </block> - </outcome> - </switch> - </block> - </outcome> - </switch> - <switch test='`$service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`'> - <outcome value='PendingCreate'> - <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-unassign' mode='sync' ></call> - </outcome> - <outcome value='PendingDelete'> - <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-unassign' mode='sync' ></call> + </switch> + </block> + </outcome> + </switch> + <switch test="`$network-topology-operation-input.network-information.network-instance-group-id`"> + <outcome value=""> + <return status="success"></return> + </outcome> + <outcome value="Other"> + <block> + <switch test="`$service-data.network-instance-groups.network-instance-group_length`"> + <outcome value=""> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-instance-group-id not found in service-data"/> + </return> </outcome> - <outcome value='Other'> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="`'Network is not in appropriate state for unassign. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`" /> - </return> + <outcome value="Other"> + <block atomic="true"> + <for index="ngidx" start="0" end="`$service-data.network-instance-groups.network-instance-_length`"> + <switch test="`$service-data.network-instance-groups.network-instance-group[$nidx].network-instance-group-id == $network-topology-operation-input.network-information.network-instance-group-id`"> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="tmp.ngidx" value="`$ngidx`"/> + <parameter name="ctx.network-instance-group-data." value="`$service-data.network-instance-groups.network-instance-group[$ngidx].`"/> + </set> + </block> + </outcome> + </switch> + </for> + </block> </outcome> - </switch> - </block> - </outcome> - <outcome value='create'> - <switch test='`$network-topology-operation-input.request-information.request-action`'> - <outcome value='CreateSOTNConnectivityInstance'> - <call module='GENERIC-RESOURCE-API' rpc='sotn-network-topology-operation-create' mode='sync' ></call> - </outcome> - <outcome value='CreateSDWANConnectivityInstance'> - <call module='GENERIC-RESOURCE-API' rpc='sdwan-network-topology-operation-create' mode='sync' ></call> - </outcome> - <outcome value='other'> - <block atomic="true"> - <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-create' mode='sync' ></call> - </block> - </outcome> + </switch> + </block> + </outcome> </switch> + <call module="GENERIC-RESOURCE-API" rpc="network-topology-operation-deactivate" mode="sync"></call> + </block> </outcome> - <outcome value='delete'> - <switch test='`$network-topology-operation-input.request-information.request-action`'> - <outcome value='DeleteSOTNConnectivityInstance'> - <call module='GENERIC-RESOURCE-API' rpc='sotn-network-topology-operation-delete' mode='sync' ></call> - </outcome> - <outcome value='DeleteSDWANConnectivityInstance'> - <call module='GENERIC-RESOURCE-API' rpc='sdwan-network-topology-operation-delete' mode='sync' ></call> - </outcome> - <outcome value='other'> - <block atomic="true"> - <call module='GENERIC-RESOURCE-API' rpc='network-topology-operation-delete' mode='sync' ></call> - </block> - </outcome> + </execute> + </outcome> + </switch> + </outcome> + <outcome value="unassign"> + <block atomic="true"> + <switch test="`$service-data.networks.network_length`"> + <outcome value=""> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data"/> + </return> + </outcome> + <outcome value="Other"> + <block atomic="true"> + <for index="nidx" start="0" end="`$service-data.networks.network_length`"> + <switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`"> + <outcome value="true"> + <set> + <parameter name="tmp.nidx" value="`$nidx`"/> + <parameter name="network-data." value="`$service-data.networks.network[$nidx].`"/> + </set> + </outcome> </switch> + </for> + <switch test="`$tmp.nidx`"> + <outcome value=""> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data"/> + </return> + </outcome> + <outcome value="Other"> + <set> + <parameter name="nidx" value="`$tmp.nidx`"/> + </set> + </outcome> + </switch> + </block> + </outcome> + </switch> + <switch test="`$network-topology-operation-input.network-information.network-instance-group-id`"> + <outcome value=""> + <return status="success"></return> + </outcome> + <outcome value="Other"> + <block> + <switch test="`$service-data.network-instance-groups.network-instance-group_length`"> + <outcome value=""> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-instance-group-id not found in service-data"/> + </return> + </outcome> + <outcome value="Other"> + <block atomic="true"> + <for index="ngidx" start="0" end="`$service-data.network-instance-groups.network-instance-_length`"> + <switch test="`$service-data.network-instance-groups.network-instance-group[$nidx].network-instance-group-id == $network-topology-operation-input.network-information.network-instance-group-id`"> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="tmp.ngidx" value="`$ngidx`"/> + <parameter name="ctx.network-instance-group-data." value="`$service-data.network-instance-groups.network-instance-group[$ngidx].`"/> + </set> + </block> + </outcome> + </switch> + </for> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + <switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`"> + <outcome value="PendingCreate"> + <call module="GENERIC-RESOURCE-API" rpc="network-topology-operation-unassign" mode="sync"></call> + </outcome> + <outcome value="PendingDelete"> + <call module="GENERIC-RESOURCE-API" rpc="network-topology-operation-unassign" mode="sync"></call> + </outcome> + <outcome value="Other"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Network is not in appropriate state for unassign. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`"/> + </return> + </outcome> + </switch> + </block> + </outcome> + <outcome value="create"> + <switch test="`$network-topology-operation-input.request-information.request-action`"> + <outcome value="CreateSOTNConnectivityInstance"> + <call module="GENERIC-RESOURCE-API" rpc="sotn-network-topology-operation-create" mode="sync"></call> + </outcome> + <outcome value="CreateSDWANConnectivityInstance"> + <call module="GENERIC-RESOURCE-API" rpc="sdwan-network-topology-operation-create" mode="sync"></call> + </outcome> + <outcome value="other"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.service-information.onap-model-information.model-name`"/> + <parameter name="target" value="wan-connection"/> + <outcome value="true"> + <call module="GENERIC-RESOURCE-API" rpc="wan-connection-topology-operation-create" mode="sync"></call> </outcome> - <outcome value='reoptimize'> - <switch test='`$network-topology-operation-input.request-information.request-action`'> - <outcome value='ReoptimizeSOTNInstance'> - <call module='GENERIC-RESOURCE-API' rpc='sotn-network-topology-operation-reoptimize' mode='sync' ></call> - </outcome> - </switch> + <outcome value="false"> + <block atomic="true"> + <call module="GENERIC-RESOURCE-API" rpc="network-topology-operation-create" mode="sync"></call> + </block> </outcome> - <outcome value='Other'> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" /> - </return> + </execute> + </outcome> + </switch> + </outcome> + <outcome value="delete"> + <switch test="`$network-topology-operation-input.request-information.request-action`"> + <outcome value="DeleteSOTNConnectivityInstance"> + <call module="GENERIC-RESOURCE-API" rpc="sotn-network-topology-operation-delete" mode="sync"></call> + </outcome> + <outcome value="DeleteSDWANConnectivityInstance"> + <call module="GENERIC-RESOURCE-API" rpc="sdwan-network-topology-operation-delete" mode="sync"></call> + </outcome> + <outcome value="other"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.service-information.onap-model-information.model-name`"/> + <parameter name="target" value="wan-connection"/> + <outcome value="true"> + <call module="GENERIC-RESOURCE-API" rpc="wan-connection-topology-operation-deactivate" mode="sync"></call> </outcome> - </switch> - <set> - <parameter name="ack-final" value="Y"/> - </set> - <return status='success'> - <parameter name="ack-final-indicator" value="Y" /> - <parameter name="error-code" value="200" /> - <parameter name="error-message" value="`$error-message`" /> - </return> - </block> - </method> + <outcome value="false"> + <block atomic="true"> + <call module="GENERIC-RESOURCE-API" rpc="network-topology-operation-delete" mode="sync"></call> + </block> + </outcome> + </execute> + </outcome> + </switch> + </outcome> + <outcome value="Other"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="sdnc-request-header.svc-action is a required input"/> + </return> + </outcome> + </switch> + <set> + <parameter name="ack-final" value="Y"/> + </set> + <return status="success"> + <parameter name="ack-final-indicator" value="Y"/> + <parameter name="error-code" value="200"/> + <parameter name="error-message" value="`$error-message`"/> + </return> + </block> + </method> </service-logic> diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_wan-connection-topology-operation-activate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_wan-connection-topology-operation-activate.xml new file mode 100644 index 00000000..fbae8f81 --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_wan-connection-topology-operation-activate.xml @@ -0,0 +1,217 @@ +<?xml version="1.0" encoding="utf-8"?> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module="GENERIC-RESOURCE-API" version="${project.version}"> + <method rpc="wan-connection-topology-operation-activate" mode="sync"> + <block atomic="true"> + <execute plugin="org.onap.ccsdk.sli.plugins.prop.PropertiesNode" method="readProperties"> + <parameter name="fileName" value="%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties"/> + <parameter name="contextPrefix" value="prop"/> + </execute> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="replace"> + <parameter name="source" value="`$prop.network-provided-resource`"/> + <parameter name="outputPath" value="tmp.services-url"/> + <parameter name="target" value="{service-instance-id}"/> + <parameter name="replacement" value="`$network-topology-operation-input.service-information.service-id`"/> + </execute> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="restapiUrl" value="`$prop.controller.url + $tmp.services-url`"/> + <parameter name="restapiUser" value="`$prop.controller.user`"/> + <parameter name="restapiPassword" value="`$prop.controller.pwd`"/> + <parameter name="format" value="json"/> + <parameter name="httpMethod" value="GET"/> + <parameter name="responsePrefix" value="mdsal-psd"/> + <outcome value="success"> + <block></block> + </outcome> + <outcome value="Other"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: Parent service data not available"/> + </return> + </outcome> + </execute> + <set> + <parameter name="tmp.found-network-input" value="false"/> + </set> + <for index="pidx" start="0" end="`$mdsal-psd.service-data.networks.network_length`"> + <switch test="`$mdsal-psd.service-data.networks.network[$pidx].network-data.network-information.onap-model-information.model-name == $network-topology-operation-input.network-information.onap-model-information.model-name`"> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="tmp.pidx" value="`$pidx`"/> + <parameter name="tmp.network." value="`$mdsal-psd.service-data.networks.network[$pidx].`"/> + <parameter name="tmp.network-input-parameters" value="`$mdsal-psd.service-data.networks.network[$pidx].network-data.network-request-input.network-input-parameters`"/> + <parameter name="tmp.found-network-input" value="true"/> + </set> + </block> + </outcome> + </switch> + </for> + <switch test="`$found-network-input`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: Network input parameters not found"/> + </return> + </outcome> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="tmp.restapiUrl-found" value="false"/> + <parameter name="tmp.restapiUser-found" value="false"/> + <parameter name="tmp.restapiPassword-found" value="false"/> + <parameter name="tmp.templateFileName-found" value="false"/> + <parameter name="tmp.thirdPartyAdaptorRpc-found" value="false"/> + </set> + <for index="cidx" start="0" end="`$tmp.network.network-data.network-topology.network-parameters.network-parameter_length`"> + <block> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'restapiUrl'`"> + <outcome value="true"> + <set> + <parameter name="tmp.restapiUrl" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.restapiUrl-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'restapiUser'`"> + <outcome value="true"> + <set> + <parameter name="tmp.restapiUser" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.restapiUser-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'restapiPassword'`"> + <outcome value="true"> + <set> + <parameter name="tmp.restapiPassword" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.restapiPassword-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'templateFileName'`"> + <outcome value="true"> + <set> + <parameter name="tmp.templateFileName" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.templateFileName-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'thirdPartyAdaptorRpc'`"> + <outcome value="true"> + <set> + <parameter name="tmp.thirdPartyAdaptorRpc" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.thirdPartyAdaptorRpc-found" value="true"/> + </set> + </outcome> + </switch> + </block> + </for> + <switch test="`$tmp.thirdPartyAdaptorRpc-found == 'true'`"> + <outcome value="true"> + <call module="GENERIC-RESOURCE-API" rpc="`$tmp.thirdPartyAdaptorRpc`" mode="sync"> + <outcome value="success"> + <block></block> + </outcome> + <outcome value="failure"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.thirdPartyAdaptorRpc`"/> + </return> + </outcome> + <outcome value="not-found"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.thirdPartyAdaptorRpc`"/> + </return> + </outcome> + </call> + </outcome> + <outcome value="false"> + <switch test="`$tmp.restapiUrl-found == 'true'`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: 3rd party controller restapiUrl not found"/> + </return> + </outcome> + <outcome value="true"> + <switch test="`$tmp.restapiUser-found == 'true'`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: 3rd party controller restapiUser not found"/> + </return> + </outcome> + <outcome value="true"> + <switch test="`$tmp.restapiPassword-found == 'true'`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: 3rd party controller restapiPassword not found"/> + </return> + </outcome> + <outcome value="true"> + <switch test="`$tmp.templateFileName-found == 'true'`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: 3rd party controller templateFileName not found"/> + </return> + </outcome> + <outcome value="true"> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="templateFileName" value="`$tmp.templateFileName`"/> + <parameter name="restapiUrl" value="`$tmp.restapiUrl`"/> + <parameter name="restapiUser" value="`$tmp.restapiUser`"/> + <parameter name="restapiPassword" value="`$tmp.restapiPassword`"/> + <parameter name="format" value="json"/> + <parameter name="httpMethod" value="post"/> + <parameter name="responsePrefix" value="restApi-result"/> + <outcome value="success"> + <block></block> + </outcome> + <outcome value="failure"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.restapiUrl`"/> + </return> + </outcome> + <outcome value="not-found"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.restapiUrl`"/> + </return> + </outcome> + </execute> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + </switch> + </block> + </outcome> + </switch> + <return status="success"> + <parameter name="ack-final-indicator" value="Y"/> + <parameter name="error-code" value="200"/> + <parameter name="error-message" value="`$error-message`"/> + </return> + </block> + </method> +</service-logic> diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_wan-connection-topology-operation-create.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_wan-connection-topology-operation-create.xml new file mode 100644 index 00000000..61453eaf --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_wan-connection-topology-operation-create.xml @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="utf-8"?> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module="GENERIC-RESOURCE-API" version="${project.version}"> + <method rpc="wan-connection-topology-operation-create" mode="sync"> + <block atomic="true"> + <switch test="`$network-topology-operation-input.network-information.network-id`"> + <outcome value=""> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID"> + <parameter name="ctx-destination" value="network-topology-operation-input.network-information.network-id"/> + <outcome value="failure"> + <return status="failure"> + <parameter name="error-code" value=""/> + <parameter name="error-message" value="An error occured while generation allotted resource ID"/> + </return> + </outcome> + </execute> + </outcome> + <outcome value="Other"></outcome> + </switch> + <execute plugin="org.onap.ccsdk.sli.plugins.prop.PropertiesNode" method="readProperties"> + <parameter name="fileName" value="%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties"/> + <parameter name="contextPrefix" value="prop"/> + </execute> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="specification"/> + <outcome value="true"> + <call module="GENERIC-RESOURCE-API" rpc="wan-connection-save-specification" mode="sync"></call> + </outcome> + <outcome value="false"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="FC"/> + <outcome value="true"> + <call module="GENERIC-RESOURCE-API" rpc="wan-connection-find-specifications" mode="sync"></call> + </outcome> + <outcome value="false"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="FD"/> + <outcome value="true"> + <call module="GENERIC-RESOURCE-API" rpc="wan-connection-find-specifications" mode="sync"></call> + </outcome> + <outcome value="false"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="Link"/> + <outcome value="true"> + <call module="GENERIC-RESOURCE-API" rpc="wan-connection-route-calculation" mode="sync"></call> + </outcome> + <outcome value="false"> + <block></block> + </outcome> + </execute> + </outcome> + </execute> + </outcome> + </execute> + </outcome> + </execute> + <return status="success"> + <parameter name="ack-final-indicator" value="Y"/> + <parameter name="error-code" value="200"/> + <parameter name="error-message" value="`$error-message`"/> + </return> + </block> + </method> +</service-logic> diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_wan-connection-topology-operation-deactivate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_wan-connection-topology-operation-deactivate.xml new file mode 100644 index 00000000..592fb65d --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_wan-connection-topology-operation-deactivate.xml @@ -0,0 +1,215 @@ +<?xml version="1.0" encoding="utf-8"?> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module="GENERIC-RESOURCE-API" version="${project.version}"> + <method rpc="wan-connection-topology-operation-deactivate" mode="sync"> + <block atomic="true"> + <execute plugin="org.onap.ccsdk.sli.plugins.prop.PropertiesNode" method="readProperties"> + <parameter name="fileName" value="%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties"/> + <parameter name="contextPrefix" value="prop"/> + </execute> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="replace"> + <parameter name="source" value="`$prop.network-provided-resource`"/> + <parameter name="outputPath" value="tmp.services-url"/> + <parameter name="target" value="{service-instance-id}"/> + <parameter name="replacement" value="`$network-topology-operation-input.service-information.service-id`"/> + </execute> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="restapiUrl" value="`$prop.controller.url + $tmp.services-url`"/> + <parameter name="restapiUser" value="`$prop.controller.user`"/> + <parameter name="restapiPassword" value="`$prop.controller.pwd`"/> + <parameter name="format" value="json"/> + <parameter name="httpMethod" value="GET"/> + <parameter name="responsePrefix" value="mdsal-psd"/> + <outcome value="success"> + <block></block> + </outcome> + <outcome value="Other"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: Parent service data not available"/> + </return> + </outcome> + </execute> + <set> + <parameter name="tmp.found-network-input" value="false"/> + </set> + <for index="pidx" start="0" end="`$mdsal-psd.service-data.networks.network_length`"> + <switch test="`$mdsal-psd.service-data.networks.network[$pidx].network-id == $network-topology-operation-input.network-information.network-id`"> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="tmp.pidx" value="`$pidx`"/> + <parameter name="tmp.network." value="`$mdsal-psd.service-data.networks.network[$pidx].`"/> + <parameter name="tmp.network-input-parameters" value="`$mdsal-psd.service-data.networks.network[$pidx].network-data.network-request-input.network-input-parameters`"/> + <parameter name="tmp.found-network-input" value="true"/> + </set> + </block> + </outcome> + </switch> + </for> + <switch test="`$found-network-input`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: Network input parameters not found"/> + </return> + </outcome> + <outcome value="true"> + <block atomic="true"> + <set> + <parameter name="tmp.restapiUrl-found" value="false"/> + <parameter name="tmp.restapiUser-found" value="false"/> + <parameter name="tmp.restapiPassword-found" value="false"/> + <parameter name="tmp.thirdPartyAdaptorRpc-found" value="false"/> + <parameter name="tmp.actualId-found" value="false"/> + </set> + <for index="cidx" start="0" end="`$tmp.network.network-data.network-topology.network-parameters.network-parameter_length`"> + <block> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'restapiUrl-deactivate'`"> + <outcome value="true"> + <set> + <parameter name="tmp.restapiUrl" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.restapiUrl-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'restapiUser'`"> + <outcome value="true"> + <set> + <parameter name="tmp.restapiUser" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.restapiUser-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'restapiPassword'`"> + <outcome value="true"> + <set> + <parameter name="tmp.restapiPassword" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.restapiPassword-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'actualId'`"> + <outcome value="true"> + <set> + <parameter name="tmp.actualId" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.actualId-found" value="true"/> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-name == 'thirdPartyAdaptorRpc-deactivate'`"> + <outcome value="true"> + <set> + <parameter name="tmp.thirdPartyAdaptorRpc" value="`$tmp.network.network-data.network-topology.network-parameters.network-parameter[$cxid].network-parameter-value`"/> + <parameter name="tmp.thirdPartyAdaptorRpc-found" value="true"/> + </set> + </outcome> + </switch> + </block> + </for> + <switch test="`$tmp.thirdPartyAdaptorRpc-found == 'true'`"> + <outcome value="true"> + <call module="GENERIC-RESOURCE-API" rpc="`$tmp.thirdPartyAdaptorRpc`" mode="sync"> + <outcome value="success"> + <block></block> + </outcome> + <outcome value="failure"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.thirdPartyAdaptorRpc`"/> + </return> + </outcome> + <outcome value="not-found"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.thirdPartyAdaptorRpc`"/> + </return> + </outcome> + </call> + </outcome> + <outcome value="false"> + <switch test="`$tmp.restapiUrl-found == 'true'`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: 3rd party controller restapiUrl not found"/> + </return> + </outcome> + <outcome value="true"> + <switch test="`$tmp.restapiUser-found == 'true'`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: 3rd party controller restapiUser not found"/> + </return> + </outcome> + <outcome value="true"> + <switch test="`$tmp.restapiPassword-found == 'true'`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: 3rd party controller restapiPassword not found"/> + </return> + </outcome> + <outcome value="true"> + <switch test="`$tmp.actualId-found == 'true'`"> + <outcome value="false"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="404"/> + <parameter name="error-message" value="Error: Wan Connection actualId not found"/> + </return> + </outcome> + <outcome value="true"> + <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> + <parameter name="restapiUrl" value="`$tmp.restapiUrl + $tmp.actualId`"/> + <parameter name="restapiUser" value="`$tmp.restapiUser`"/> + <parameter name="restapiPassword" value="`$tmp.restapiPassword`"/> + <parameter name="format" value="json"/> + <parameter name="httpMethod" value="delete"/> + <outcome value="success"> + <block></block> + </outcome> + <outcome value="failure"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.restapiUrl`"/> + </return> + </outcome> + <outcome value="not-found"> + <return status="failure"> + <parameter name="ack-final" value="Y"/> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Error calling ' + $tmp.restapiUrl`"/> + </return> + </outcome> + </execute> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + </switch> + </outcome> + </switch> + </block> + </outcome> + </switch> + <return status="success"> + <parameter name="ack-final-indicator" value="Y"/> + <parameter name="error-code" value="200"/> + <parameter name="error-message" value="`$error-message`"/> + </return> + </block> + </method> +</service-logic> diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_wan-connection-topology-operation-delete.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_wan-connection-topology-operation-delete.xml new file mode 100644 index 00000000..9c24e525 --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_wan-connection-topology-operation-delete.xml @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="utf-8"?> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module="GENERIC-RESOURCE-API" version="${project.version}"> + <method rpc="wan-connection-topology-operation-delete" mode="sync"> + <block atomic="true"> + <switch test="`$network-topology-operation-input.network-information.network-id`"> + <outcome value=""> + <return status="failure"> + <parameter name="error-code" value=""/> + <parameter name="error-message" value="An error occured while generation allotted resource ID"/> + </return> + </outcome> + <outcome value="Other"></outcome> + </switch> + <execute plugin="org.onap.ccsdk.sli.plugins.prop.PropertiesNode" method="readProperties"> + <parameter name="fileName" value="%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties"/> + <parameter name="contextPrefix" value="prop"/> + </execute> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="FC"/> + <outcome value="true"> + <block atomic="true"> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder"> + <parameter name="file" value="/opt/opendaylight/current/data/log/svclogic.log"/> + <parameter name="field1" value="__TIMESTAMP__"/> + <parameter name="field2" value="wan-connection-topology-operation-delete"/> + <parameter name="field3" value="`$network-topology-operation-input.network-information.onap-model-information.model-name + ' delete'`"/> + </record> + <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="connectivity" key="connectivity.connectivity-id = $network-topology-operation-input.network-information.network-id"></delete> + <set> + <parameter name="service-data.networks.network_length" value="`$service-data.networks.network_length - 1`"/> + </set> + <set> + <parameter name="service-data.networks.network[$tmp.nidx]." value=""/> + </set> + <set> + <parameter name="networkId" value="`$network-topology-operation-input.network-information.network-id`"/> + <parameter name="service-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $network-topology-operation-input.service-information.service-instance-id + '/service-data/service-topology/'` "/> + </set> + </block> + </outcome> + <outcome value="false"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains"> + <parameter name="source" value="`$network-topology-operation-input.network-information.onap-model-information.model-name`"/> + <parameter name="target" value="FD"/> + <outcome value="true"> + <block atomic="true"> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder"> + <parameter name="file" value="/opt/opendaylight/current/data/log/svclogic.log"/> + <parameter name="field1" value="__TIMESTAMP__"/> + <parameter name="field2" value="wan-connection-topology-operation-delete"/> + <parameter name="field3" value="`$network-topology-operation-input.network-information.onap-model-information.model-name + ' delete'`"/> + </record> + <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="connectivity" key="connectivity.connectivity-id = $network-topology-operation-input.network-information.network-id"></delete> + <set> + <parameter name="service-data.networks.network_length" value="`$service-data.networks.network_length - 1`"/> + </set> + <set> + <parameter name="service-data.networks.network[$tmp.nidx]." value=""/> + </set> + <set> + <parameter name="networkId" value="`$network-topology-operation-input.network-information.network-id`"/> + <parameter name="service-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $network-topology-operation-input.service-information.service-instance-id + '/service-data/service-topology/'` "/> + </set> + </block> + </outcome> + <outcome value="false"> + <block></block> + </outcome> + </execute> + </outcome> + </execute> + <return status="success"> + <parameter name="ack-final-indicator" value="Y"/> + <parameter name="error-code" value="200"/> + <parameter name="error-message" value="`$error-message`"/> + </return> + </block> + </method> +</service-logic> |