diff options
author | Hesam Rahimi <hesam.rahimi@huawei.com> | 2020-03-04 03:03:57 +0000 |
---|---|---|
committer | Hesam Rahimi <hesam.rahimi@huawei.com> | 2020-03-04 21:52:46 +0000 |
commit | ae8f83510948c360ec4952fe7a73bfca1a930277 (patch) | |
tree | aef6eaaa6a4256744f1c03c5cc2e5adedbc11ac9 /platform-logic/generic-resource-api/src/main/xml | |
parent | 0a8e7414c87424bd9bf0616d14bce525c9a16e24 (diff) |
DGs for SOTN NNI based service creation
Issue-ID: SDNC-900
Signed-off-by: Hesam Rahimi <hesam.rahimi@huawei.com>
Change-Id: I3ae8efc39aaa5fc5de48b3323f986531d3c7fa74
Former-commit-id: 84477fc8f92e417f809ffe040ffb12de46a43a77
Diffstat (limited to 'platform-logic/generic-resource-api/src/main/xml')
13 files changed, 1500 insertions, 17 deletions
diff --git a/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-create-otn-tunnel.xml b/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-create-otn-tunnel.xml new file mode 100644 index 00000000..4527b788 --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-create-otn-tunnel.xml @@ -0,0 +1,125 @@ +<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='sotn-create-otn-tunnel' mode='sync'>
+ <block atomic="true">
+ <switch test='`$oof.vpn.access-provider-id`'>
+ <outcome value='`$domain-A.provider-id`'>
+
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.otn-domain.' value='`$domain-A.`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='`$domain-B.provider-id`'>
+
+ <block atomic="true">
+ <set>
+ <parameter name='$tmp.otn-domain.' value='`$domain-B.`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$oof.vpn.access-node-id`'>
+ <outcome value='`$oof.vpns[0].access-node-id`'>
+
+ <block atomic="true">
+ <set>
+ <parameter name='ietf-te_te.tunnels.tunnel[0].source' value='`$oof.vpn.access-node-id`' />
+ <parameter name='ietf-te_te.tunnels.tunnel[0].destination' value='`$otn-domain.node-id`' />
+ <parameter name='ietf-te_te.tunnels.tunnel[0].dst-ttp-id' value='`$otn-domain.ttp-id`' />
+ <parameter name='ietf-te_te.tunnels.tunnel[0].ietf-otn-tunnel_dst-tpn' value='`$otn-domain.tpn`' />
+ <parameter name='ietf-te_te.tunnels.tunnel[0].name' value='otntunnel-22' />
+ <parameter name='ietf-te_te.tunnels.tunnel[0].te-topology-identifier.client-id' value='`$otn-domain.client-id`' />
+ <parameter name='ietf-te_te.tunnels.tunnel[0].te-topology-identifier.provider-id' value='`$otn-domain.provider-id`' />
+ <parameter name='ietf-te_te.tunnels.tunnel[0].te-topology-identifier.topology-id' value='`$otn-domain.te-topo-id`' />
+ <parameter name='ietf-te_te.tunnels.tunnel[1].source' value='`$oof.vpn.access-node-id`' />
+ <parameter name='ietf-te_te.tunnels.tunnel[1].destination' value='`$otn-domain.node-id`' />
+ <parameter name='ietf-te_te.tunnels.tunnel[1].name' value='tptunnel-22' />
+ <parameter name='ietf-te_te.tunnels.tunnel[1].dependency-tunnels.dependency-tunnel[0].name' value='otntunnel-22' />
+ <parameter name='ietf-te_te.tunnels.tunnel[1].te-topology-identifier.client-id' value='`$oof.vpn.access-client-id`' />
+ <parameter name='ietf-te_te.tunnels.tunnel[1].te-topology-identifier.provider-id' value='`$oof.vpn.access-provider-id`' />
+ <parameter name='ietf-te_te.tunnels.tunnel[1].te-topology-identifier.topology-id' value='`$oof.vpn.access-topology-id`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='`$oof.vpns[$oof.vpns_length].access-node-id`'>
+
+ <block atomic="true">
+ <set>
+ <parameter name='ietf-te_te.tunnels.tunnel[0].destination' value='`$oof.vpn.access-node-id`' />
+ <parameter name='ietf-te_te.tunnels.tunnel[0].source' value='`$otn-domain.node-id`' />
+ <parameter name='ietf-te_te.tunnels.tunnel[0].src-ttp-id' value='`$otn-domain.ttp-id`' />
+ <parameter name='ietf-te_te.tunnels.tunnel[0].ietf-otn-tunnel_src-tpn' value='`$otn-domain.tpn`' />
+ <parameter name='ietf-te_te.tunnels.tunnel[0].name' value='otntunnel-22' />
+ <parameter name='ietf-te_te.tunnels.tunnel[0].te-topology-identifier.client-id' value='`$otn-domain.client-id`' />
+ <parameter name='ietf-te_te.tunnels.tunnel[0].te-topology-identifier.provider-id' value='`$otn-domain.provider-id`' />
+ <parameter name='ietf-te_te.tunnels.tunnel[0].te-topology-identifier.topology-id' value='`$otn-domain.te-topo-id`' />
+ <parameter name='ietf-te_te.tunnels.tunnel[1].destination' value='`$oof.vpn.access-node-id`' />
+ <parameter name='ietf-te_te.tunnels.tunnel[1].source' value='`$otn-domain.node-id`' />
+ <parameter name='ietf-te_te.tunnels.tunnel[1].name' value='tptunnel-22' />
+ <parameter name='ietf-te_te.tunnels.tunnel[1].dependency-tunnels.dependency-tunnel[0].name' value='otntunnel-22' />
+ <parameter name='ietf-te_te.tunnels.tunnel[1].te-topology-identifier.client-id' value='`$oof.vpn.access-client-id`' />
+ <parameter name='ietf-te_te.tunnels.tunnel[1].te-topology-identifier.provider-id' value='`$oof.vpn.access-provider-id`' />
+ <parameter name='ietf-te_te.tunnels.tunnel[1].te-topology-identifier.topology-id' value='`$oof.vpn.access-topology-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$prop.sdncRestApi.token_id`">
+ <outcome value=''>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiCallNode' method='sendRequest' >
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/restconf/data/ietf-te:te'`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json"/>
+ <parameter name="httpMethod" value="patch"/>
+ <parameter name='dirPath' value="/opt/sdnc/restapi/yang" />
+ <parameter name="responsePrefix" value="vpn-result"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.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'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing Create vpn rest api" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ </outcome>
+ <outcome value='Other'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiCallNode' method='sendRequest' >
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/restconf/data/ietf-te:te'`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json"/>
+ <parameter name="httpMethod" value="patch"/>
+ <parameter name='dirPath' value="/opt/sdnc/restapi/yang" />
+ <parameter name="responsePrefix" value="vpn-result"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <parameter name='customHttpHeaders' value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing Create vpn rest api" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-get-otn-tunnel-path-from-oof.xml b/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-get-otn-tunnel-path-from-oof.xml new file mode 100644 index 00000000..9a86f933 --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-get-otn-tunnel-path-from-oof.xml @@ -0,0 +1,266 @@ +<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='sotn-get-otn-tunnel-path-from-oof' mode='sync'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/' + $prop.restapi.oof-getpath.templatefile`" />
+ <parameter name="restapiUrl" value="`$prop.restapi.connection-oof-url`" />
+ <parameter name="restapiUser" value="`$prop.oof.user`" />
+ <parameter name="restapiPassword" value="`$prop.oof.password`" />
+ <parameter name="format" value="json"/>
+ <parameter name="httpMethod" value="post"/>
+ <parameter name="responsePrefix" value="otn-oof"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <parameter name='customHttpHeaders' value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing OOF api" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ </execute>
+ <for index='vidx' start='0' end='`$otn-oof.otn-links_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='otn-oof.link-name' value='`$otn-oof.solutions[$vidx].`' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="logical-link"
+ key="logical-link.link-name = $otn-oof.link-name
+ AND depth = '0'"
+ pfx='tmp.aai.cross-link' local-only='false' >
+ <outcome value='success'>
+ <switch test='`$tmp.aai.cross-link.link-role`'>
+ <outcome value='cross-domain-link'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.cross-link.src-ltpId' value="`$tmp.aai.cross-link.relationship-list.relationship[0].relationship-data[0].relationship-value`" />
+ <parameter name='tmp.cross-link.dst-ltpId' value="`$tmp.aai.cross-link.relationship-list.relationship[1].relationship-data[0].relationship-value`" />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="p-interface"
+ key="p-interface.interface-name = $tmp.src-ltpId
+ AND depth = '0'"
+ pfx='tmp.aai.src-tp' local-only='false' >
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.src-pnf-name' value="`$tmp.aai.src-tp.relationship-list.relationship[0].relationship-data[0].relationship-value`" />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="pnf"
+ key="pnf.pnf-name = $tmp.src-pnf-name
+ AND depth = '0'"
+ pfx='tmp.aai.src-pnf' local-only='false' >
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='domain-A.node-id' value="`$tmp.aai.src-pnf.pnf-id`" />
+ <parameter name='domain-A.tpn' value='1' />
+ </set>
+ <for silentFailure='true' index='vidx' start='0' end='`$tmp.aai.src-pnf.relationship-list.relationship_length`' >
+ <switch test='`$tmp.aai.src-pnf.relationship-list.relationship[$vidx].related-to`'>
+ <outcome value='tunnel-termination-point'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.src-ttp-id' value="`$tmp.aai.src-pnf.relationship-list.relationship[$vidx].relationship-data[0].relationship-value`" />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="tunnel-termination-point"
+ key="tunnel-termination-point.ttp-id = $tmp.src-ttp-id
+ AND depth = '0'"
+ pfx='tmp.aai.src-ttp' local-only='false' >
+ <outcome value='success'>
+ <set>
+ <parameter name='domain-A.ttp-id' value="`$tmp.aai.src-ttp.ttp-id`" />
+ </set>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value='network-resource'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.domain-A.network-id' value="`$tmp.aai.src-pnf.relationship-list.relationship[$vidx].relationship-data[0].relationship-value`" />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-resource"
+ key="network-resource.network-id = $tmp.domain-A.network-id
+ AND depth = '0'"
+ pfx='tmp.aai.src-network-resource' local-only='false' >
+ <outcome value='success'>
+ <set>
+ <parameter name='domain-A.network-id' value="`$tmp.aai.src-network-resource.network-id`" />
+ <parameter name='domain-A.provider-id' value="`$tmp.aai.src-network-resource.provider-id`" />
+ <parameter name='domain-A.client-id' value="`$tmp.aai.src-network-resource.client-id`" />
+ <parameter name='domain-A.te-topo-id' value="`$tmp.aai.src-network-resource.te-topo-id`" />
+ <parameter name='domain-A.network-type' value="`$tmp.aai.src-network-resource.network-type`" />
+ </set>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </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="`'An error occurred while querying pnf from AnAI with pnf-name = ' + $prop.connection-attachement.access-node-id`" />
+ </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="`'Unexpected error occurred while querying pnf from AnAI with pnf-name = ' + $prop.connection-attachement.access-node-id`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </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="`'An error occurred while querying pnf from AnAI with pnf-name = ' + $prop.connection-attachement.access-node-id`" />
+ </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="`'Unexpected error occurred while querying pnf from AnAI with pnf-name = ' + $prop.connection-attachement.access-node-id`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="p-interface"
+ key="p-interface.interface-name = $tmp.dst-ltpId
+ AND depth = '0'"
+ pfx='tmp.aai.dst-tp' local-only='false' >
+ <outcome value='success'>
+ <set>
+ <parameter name='tmp.dst-pnf-name' value="`$tmp.aai.dst-tp.relationship-list.relationship[0].relationship-data[0].relationship-value`" />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="pnf"
+ key="pnf.pnf-name = $tmp.dst-pnf-name
+ AND depth = '0'"
+ pfx='tmp.aai.dst-pnf' local-only='false' >
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='domain-B.node-id' value="`$tmp.aai.dst-pnf.pnf-id`" />
+ <parameter name='domain-B.tpn' value='1' />
+ </set>
+ <for silentFailure='true' index='vidx' start='0' end='`$tmp.aai.dst-pnf.relationship-list.relationship_length`' >
+ <switch test='`$tmp.aai.dst-pnf.relationship-list.relationship[$vidx].related-to`'>
+ <outcome value='tunnel-termination-point'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.dst-ttp-id' value="`$tmp.aai.dst-pnf.relationship-list.relationship[$vidx].relationship-data[0].relationship-value`" />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="tunnel-termination-point"
+ key="tunnel-termination-point.ttp-id = $tmp.dst-ttp-id
+ AND depth = '0'"
+ pfx='tmp.aai.dst-ttp' local-only='false' >
+ <outcome value='success'>
+ <set>
+ <parameter name='domain-B.ttp-id' value="`$tmp.aai.dst-ttp.ttp-id`" />
+ </set>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ <outcome value='network-resource'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.domain-B.network-id' value="`$tmp.aai.dst-pnf.relationship-list.relationship[$vidx].relationship-data[0].relationship-value`" />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-resource"
+ key="network-resource.network-id = $tmp.domain-B.network-id
+ AND depth = '0'"
+ pfx='tmp.aai.dst-network-resource' local-only='false' >
+ <outcome value='success'>
+ <set>
+ <parameter name='domain-B.network-id' value="`$tmp.aai.dst-network-resource.network-id`" />
+ <parameter name='domain-B.provider-id' value="`$tmp.aai.dst-network-resource.provider-id`" />
+ <parameter name='domain-B.client-id' value="`$tmp.aai.dst-network-resource.client-id`" />
+ <parameter name='domain-B.te-topo-id' value="`$tmp.aai.dst-network-resource.te-topo-id`" />
+ <parameter name='domain-B.network-type' value="`$tmp.aai.dst-network-resource.network-type`" />
+ </set>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </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="`'An error occurred while querying pnf from AnAI with pnf-name = ' + $prop.connection-attachement.access-node-id`" />
+ </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="`'Unexpected error occurred while querying pnf from AnAI with pnf-name = ' + $prop.connection-attachement.access-node-id`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </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="`'An error occurred while querying pnf from AnAI with pnf-name = ' + $prop.connection-attachement.access-node-id`" />
+ </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="`'Unexpected error occurred while querying pnf from AnAI with pnf-name = ' + $prop.connection-attachement.access-node-id`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <break/>
+ </block>
+ </outcome>
+ </switch>
+ </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="`'An error occurred while querying pnf from AnAI with pnf-name = ' + $prop.connection-attachement.access-node-id`" />
+ </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="`'Unexpected error occurred while querying pnf from AnAI with pnf-name = ' + $prop.connection-attachement.access-node-id`" />
+ </return>
+ </outcome>
+ </get-resource>
+ </block>
+ </for>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-get-vf-module-uni-param.xml b/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-get-vf-module-uni-param.xml new file mode 100644 index 00000000..8629403f --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-get-vf-module-uni-param.xml @@ -0,0 +1,38 @@ +<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='sotn-get-vf-module-uni-param' mode='sync'>
+ <block atomic="true">
+ <for index="idx" start="0" end="`$vf-module-request-input.vf-module-input-parameters.param_length`">
+ <block>
+ <switch test="`$vf-module-request-input.vf-module-input-parameters.param[$idx].name == 'id'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.uni.id' value='`$vf-module-request-input.vf-module-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$vf-module-request-input.vf-module-input-parameters.param[$idx].name == 'tpId'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.uni.tpId' value='`$vf-module-request-input.vf-module-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$vf-module-request-input.vf-module-input-parameters.param[$idx].name == 'cVLAN'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.uni.cVLAN' value='`$vf-module-request-input.vf-module-input-parameters.param[$idx].value`' />
+ </set>
+ </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>
+ </for>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vf-operation-l2vpn-activate.xml b/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vf-operation-l2vpn-activate.xml index ca13a5e6..e2e61c6c 100644 --- a/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vf-operation-l2vpn-activate.xml +++ b/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vf-operation-l2vpn-activate.xml @@ -1,8 +1,71 @@ <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}'>
+ 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='sotn-vf-operation-l2vpn-activate' mode='sync'>
<block atomic="true">
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='vidx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <block>
+ <switch test="`$service-data.vnfs.vnf[$vidx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`">
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.vidx' value='`$vidx`' />
+ <parameter name='ctx.vnf-data.' value='`$service-data.vnfs.vnf[$vidx].`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.order-status`'>
+ <outcome value='Created'>
+ <block atomic="true"></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="`'VNF is not in appropriate state for activate. Current state is ' + $service-data.vnfs.vnf[$tmp.nidx].vnf-data.vnf-level-oper-status.order-status`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' />
+ </set>
+ <set>
+ <parameter name='vnfId' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name="vnf-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $vnf-topology-operation-input.service-information.service-instance-id + '/service-data/vnfs/vnf/' + $vnf-topology-operation-input.vnf-information.vnf-id + '/vnf-data/'` " />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.order-status' value='Active' />
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="connectivity"
+ key="connectivity.connectivity-id = $vnfId" >
+ <parameter name="operational-status" value="Active" />
+ </update>
<return status='success'>
<parameter name="ack-final-indicator" value="Y" />
<parameter name="error-code" value="200" />
diff --git a/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vf-operation-l2vpn-create.xml b/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vf-operation-l2vpn-create.xml index 3876fd24..94e218b0 100644 --- a/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vf-operation-l2vpn-create.xml +++ b/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vf-operation-l2vpn-create.xml @@ -1,8 +1,91 @@ <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}'>
+ 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='sotn-vf-operation-l2vpn-create' mode='sync'>
<block atomic="true">
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='vnf-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='`$service-data.vnfs.vnf_length`' />
+ </set>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$vnf-topology-operation-input.vnf-information.vnf-id == $service-data.vnfs.vnf[$idx].vnf-id`'>
+ <outcome value='true'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'VNF id ' + $service-data.vnfs.vnf[$idx].vnf-id
+ + ' already exists, and has order status ' + $service-data.vnfs.vnf[$idx].vnf-data.vnf-level-oper-status.order-status`" />
+ </return>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <for index="idx" start="0" end="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`">
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name`'/>
+ <parameter name="regex" value="_"/>
+ <parameter name="ctx_memory_result_key" value="param-prefix"/>
+ </execute>
+ <set>
+ <parameter name="`vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name`" value='`$param-prefix[$param-prefix_length -1]`'/>
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='vnf-request-input.' value='`$vnf-topology-operation-input.vnf-request-input.`' />
+ </set>
+ <for index="idx" start="0" end="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`">
+ <block>
+ <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'name'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.vnfName' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf_length' value='`$vnf-index + 1`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='generateUUID' >
+ <parameter name="ctx-destination" value="prop.connectivity-id"/>
+ </execute>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-id' value='`$prop.vnf-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.' value='$vnf-topology-operation-input.vnf-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.' value='$vnf-topology-operation-input.vnf-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.vnf-id' value='`$prop.vnf-id`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='Created' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <set>
+ <parameter name='vnfId' value='`$prop.vnf-id`' />
+ <parameter name="vnf-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $vnf-topology-operation-input.service-information.service-instance-id + '/service-data/vnfs/vnf/' + $prop.vnf-id + '/vnf-data/'` " />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="connectivity"
+ key='connectivity.connectivity-id = $prop.connectivity-id' >
+ <parameter name="operational-status" value="Created" />
+ </save>
<return status='success'>
<parameter name="ack-final-indicator" value="Y" />
<parameter name="error-code" value="200" />
diff --git a/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vf-operation-l2vpn-deactivate.xml b/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vf-operation-l2vpn-deactivate.xml index c16d3b0e..20b28f29 100644 --- a/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vf-operation-l2vpn-deactivate.xml +++ b/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vf-operation-l2vpn-deactivate.xml @@ -1,8 +1,83 @@ <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}'>
+ 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='sotn-vf-operation-l2vpn-deactivate' mode='sync'>
<block atomic="true">
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='vidx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <block>
+ <switch test="`$service-data.vnfs.vnf[$vidx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vidx' value='`$vidx`' />
+ <parameter name='ctx.vnf-data.' value='`$service-data.vnfs.vnf[$vidx].`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$tmp.vidx`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.order-status`'>
+ <outcome value='Active'>
+ <block atomic="true"></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="`'VNF is not in appropriate state for activate. Current state is ' + $service-data.vnfs.vnf[$tmp.nidx].vnf-data.vnf-level-oper-status.order-status`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <!--parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' /-->
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' />
+ </set>
+ <set>
+ <parameter name='vnfId' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name="vnf-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $vnf-topology-operation-input.service-information.service-instance-id + '/service-data/vnfs/vnf/' + $vnf-topology-operation-input.vnf-information.vnf-id + '/vnf-data/'` " />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.order-status' value='PendingDelete' />
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="connectivity"
+ key="connectivity.connectivity-id = $vnfId" >
+ <parameter name="operational-status" value="PendingDelete" />
+ </update>
<return status='success'>
<parameter name="ack-final-indicator" value="Y" />
<parameter name="error-code" value="200" />
diff --git a/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vf-operation-l2vpn-delete.xml b/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vf-operation-l2vpn-delete.xml index 89a18ed8..8585db55 100644 --- a/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vf-operation-l2vpn-delete.xml +++ b/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vf-operation-l2vpn-delete.xml @@ -1,8 +1,92 @@ <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}'>
+ 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='sotn-vf-operation-l2vpn-delete' mode='sync'>
<block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' >
+ <parameter name="vnf-topology-operation-input.vnf-information.vnf-id" value="$vnf-topology-operation-input.vnf-information.vnf-id"/>
+ </execute>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='nidx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test="`$service-data.vnfs.vnf[$nidx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`">
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.nidx' value='`$nidx`' />
+ <parameter name='ctx.vnf-data.' value='`$service-data.vnfs.vnf[$nidx].vnf-data.`' />
+ </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="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf[$tmp.nidx].vnf-data.vnf-level-oper-status.order-status`'>
+ <outcome value='PendingDelete'>
+ <block atomic="true"></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="`'VNF is not in appropriate state for activate. Current state is ' + $service-data.vnfs.vnf[$tmp.nidx].vnf-data.vnf-level-oper-status.order-status`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='prop.vnfidxLen' value='`0`' />
+ </set>
+ <for index='lidx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <block atomic="true">
+ <switch test="`$service-data.vnfs.vnf[$lidx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`">
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='service-data.vnfs.vnf[$prop.vnfidxLen].vnf-id' value='`$service-data.vnfs.vnf[$lidx].vnf-id`' />
+ <parameter name='service-data.vnfs.vnf[$prop.vnfidxLen].vnf-data.' value='`$service-data.vnfs.vnf[$lidx].vnf-data.`' />
+ </set>
+ <set>
+ <parameter name='prop.vnfidxLen' value='`$prop.vnfidxLen + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name="service-data.vnfs.vnf_length" value='`$prop.vnfidxLen`'/>
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$prop.vnfidxLen]." value=""/>
+ </set>
+ <set>
+ <parameter name='vnfId' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='vnf-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vnf-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'` " />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="connectivity"
+ key="connectivity.connectivity-id = $vnfId" >
+ <parameter name="operational-status" value="PendingDelete" />
+ </delete>
<return status='success'>
<parameter name="ack-final-indicator" value="Y" />
<parameter name="error-code" value="200" />
diff --git a/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vf-operation-uni-activate.xml b/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vf-operation-uni-activate.xml index 9ccbd07f..c1e677ba 100644 --- a/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vf-operation-uni-activate.xml +++ b/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vf-operation-uni-activate.xml @@ -3,6 +3,289 @@ 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='sotn-vf-operation-uni-activate' mode='sync'>
<block atomic="true">
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test="`$service-data.vnfs.vnf[$idx].vnf-id == $vf-module-topology-operation-input.vnf-information.vnf-id`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ <set>
+ <parameter name='tmp.vnf-id' value='`$vf-module-topology-operation-input.vnf-information.vnf-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <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>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='vf-module-length' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' />
+ </set>
+ <for index='idx' start='0' end='`$vf-module-length`' >
+ <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id == $vf-module-topology-operation-input.vf-module-information.vf-module-id`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vidx' value='`$idx`' />
+ <parameter name='ctx.vf-module-data.' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-data.`' />
+ </set>
+ <set>
+ <parameter name='vf-module-request-input.' value='`$ctx.vf-module-data.vf-module-request-input.`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-get-vf-module-lanport-param' mode='sync' ></call>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="'generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id'
+ AND depth = '0'"
+ pfx='tmp.aai.generic-vnf' local-only='false' >
+ <block>
+ <for silentFailure='true' index='vidx' start='0' end='`$tmp.aai.generic-vnf.relationship-list.relationship_length`' >
+ <switch test='`$tmp.aai.src-pnf.relationship-list.relationship[$vidx].related-to`'>
+ <outcome value='uni'>
+ <block atomic="true">
+ <set>
+ <parameter name='`tmp.unis.uni[$vidx].tpId`' value="`$tmp.aai.src-pnf.relationship-list.relationship[$vidx].relationship-data[0].relationship-value`" />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value='`tmp.unis.uni[$vidx].tpId`'/>
+ <parameter name="regex" value="nodeId"/>
+ <parameter name="tmp.unis.uni[$vidx].pnf-name" value=""/>
+ <outcome value='success'>
+ <set>
+ <parameter name='prop.lan.ip-address' value='`$ipandMask[0]`' />
+ <parameter name='prop.lan.prefixLength' value='`$ipandMask[1]`' />
+ </set>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value="An error occured while splitting sna1_route" />
+ </return>
+ </outcome>
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="pnf"
+ key="`pnf.pnf-name = $tmp.unis.uni[$vidx].pnf-name AND depth = '0'`"
+ pfx='tmp.aai.pnf' local-only='false' >
+ <outcome value='success'>
+ <block>
+ <set>
+ <parameter name='`$tmp.unis.uni[$vidx].node-id`' value="`$tmp.aai.pnf.pnf-id`" />
+ </set>
+ <for silentFailure='true' index='ridx' start='0' end='`$tmp.aai.pnf.relationship-list.relationship_length`' >
+ <switch test='`$tmp.aai.src-pnf.relationship-list.relationship[$vidx].related-to`'>
+ <outcome value='thirdparty-controller'>
+ <block atomic="true">
+ <set>
+ <parameter name='`$tmp.unis.uni[$vidx].thirdparty-sdnc-id`' value="`$tmp.aai.pnf.relationship-list.relationship[$ridx].relationship-data[0].relationship-value`" />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='network-resource'>
+ <block atomic="true">
+ <set>
+ <parameter name='`$tmp.unis.uni[$vidx].network-id`' value="`$tmp.aai.pnf.relationship-list.relationship[$ridx].relationship-data[0].relationship-value`" />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="network-resource"
+ key="`network-resource.network-id = $tmp.unis.uni[$vidx].network-id AND depth = '0'`"
+ pfx='tmp.aai.network-resource' local-only='false' >
+ <outcome value='success'>
+ <set>
+ <parameter name="`$tmp.unis.uni[$vidx].network-id`" value="`$tmp.aai.network-resource.network-id`" />
+ <parameter name="`$tmp.unis.uni[$vidx].provider-id`" value="`$tmp.aai.network-resource.provider-id`" />
+ <parameter name="`$tmp.unis.uni[$vidx].client-id`" value="`$tmp.aai.network-resource.client-id`" />
+ <parameter name="`$tmp.unis.uni[$vidx].te-topo-id`" value="`$tmp.aai.network-resource.te-topo-id`" />
+ <parameter name="`$tmp.unis.uni[$vidx].network-type`" value="`$tmp.aai.network-resource.network-type`" />
+ </set>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.unis.uni_length < 2`' >
+ <outcome value='true'>
+ <return status='success'>
+ <parameter name='' value='' />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </get-resource>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-get-otn-tunnel-path-from-oof' mode='sync' ></call>
+ <for index='vidx' start='0' end='`$tmp.unis.uni_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='oof.vpn.' value='`$tmp.unis.uni[$vidx].`' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="esr-thirdparty-sdnc"
+ key="esr-thirdparty-sdnc.thirdparty-sdnc-id = $oof.vpn.thirdparty-sdnc-id AND
+ depth = '1'"
+ pfx='tmp.aai.esr-thirdparty-sdnc' local-only='false' >
+ <outcome value='success'>
+ <set>
+ <parameter name='prop.sdncRestApi.thirdpartySdnc.url' value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].service-url`" />
+ <parameter name='prop.sdncRestApi.thirdpartySdnc.user' value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].user-name`" />
+ <parameter name='prop.sdncRestApi.thirdpartySdnc.password' value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].password`" />
+ </set>
+ </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="`'An error occurred while querying esr-thirdparty-sdnc from AnAI with thirdparty-sdnc-id = ' + $tmp.thirdparty-sdnc-id`" />
+ </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="`'Unexpected error occurred while querying esr-thirdparty-sdnc from AnAI with thirdparty-sdnc-id = ' + $tmp.thirdparty-sdnc-id`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/actokentemplate.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/controller/v2/tokens'`" />
+ <parameter name="format" value="json"/>
+ <parameter name="httpMethod" value="post"/>
+ <parameter name="responsePrefix" value="token-result"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <outcome value='success'>
+ <set>
+ <parameter name='prop.sdncRestApi.token_id' value='`$token-result.data.token_id`' />
+ </set>
+ </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 executing get token rest api" />
+ </return>
+ </outcome>
+ </execute>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-create-otn-tunnel' mode='sync' ></call>
+ <set>
+ <parameter name='ietf-eth-tran-service_etht-svc.globals.etht-svc-bandwidth-profiles[0].bandwidth-profile-type' value='ietf-eth-tran-types:mef-10-bwp' />
+ <parameter name='ietf-eth-tran-service_etht-svc.etht-svc-instances[0].etht-svc-type' value='ietf-eth-tran-types:p2p-svc' />
+ <parameter name='ietf-eth-tran-service_etht-svc.etht-svc-instances[0].admin-status' value='ietf-te-types:tunnel-state-up' />
+ <parameter name='ietf-eth-tran-service_etht-svc.etht-svc-instances[0].etht-svc-access-ports[0].access-port-id' value='0' />
+ <parameter name='ietf-eth-tran-service_etht-svc.etht-svc-instances[0].etht-svc-access-ports[0].service-classification-type' value='ietf-eth-tran-types:port-classification' />
+ <parameter name='ietf-eth-tran-service_etht-svc.etht-svc-instances[0].etht-svc-access-ports[1].access-port-id' value='1' />
+ <parameter name='ietf-eth-tran-service_etht-svc.etht-svc-instances[0].etht-svc-access-ports[1].service-classification-type' value='ietf-eth-tran-types:port-classification' />
+ </set>
+ <set>
+ <parameter name='ietf-eth-tran-service_etht-svc.etht-svc-instances[0].access-provider-id' value='`$oof.vpn.access-provider-id`' />
+ <parameter name='ietf-eth-tran-service_etht-svc.etht-svc-instances[0].access-client-id' value='`$oof.vpn.access-client-id`' />
+ <parameter name='ietf-eth-tran-service_etht-svc.etht-svc-instances[0].access-topology-id' value='`$oof.vpn.access-topology-id`' />
+ <parameter name='ietf-eth-tran-service_etht-svc.etht-svc-instances[0].etht-svc-access-ports[0].access-node-id' value='`$oof.vpn.access-node-id`' />
+ <parameter name='ietf-eth-tran-service_etht-svc.etht-svc-instances[0].etht-svc-access-ports[0].access-ltp-id' value='`$oof.vpn.src-access-ltp-id`' />
+ <parameter name='ietf-eth-tran-service_etht-svc.etht-svc-instances[0].etht-svc-access-ports[1].access-node-id' value='`$oof.vpn.access-node-id`' />
+ <parameter name='ietf-eth-tran-service_etht-svc.etht-svc-instances[0].etht-svc-access-ports[1].access-ltp-id' value='`$oof.vpn.dst-access-ltp-id`' />
+ </set>
+ <switch test="`$prop.sdncRestApi.token_id`">
+ <outcome value=''>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiCallNode' method='sendRequest' >
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/restconf/data/ietf-eth-tran-service:etht-svc'`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json"/>
+ <parameter name="httpMethod" value="patch"/>
+ <parameter name='dirPath' value="/opt/sdnc/restapi/yang" />
+ <parameter name="responsePrefix" value="vpn-result"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.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'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing Create vpn rest api" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ </outcome>
+ <outcome value='Other'>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiCallNode' method='sendRequest' >
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/restconf/data/ietf-eth-tran-service:etht-svc'`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json"/>
+ <parameter name="httpMethod" value="patch"/>
+ <parameter name='dirPath' value="/opt/sdnc/restapi/yang" />
+ <parameter name="responsePrefix" value="vpn-result"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <parameter name='customHttpHeaders' value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing Create vpn rest api" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ </outcome>
+ </switch>
+ </block>
+ </for>
<return status='success'>
<parameter name="ack-final-indicator" value="Y" />
<parameter name="error-code" value="200" />
diff --git a/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vf-operation-uni-create.xml b/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vf-operation-uni-create.xml index f1c7ecd6..a549708d 100644 --- a/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vf-operation-uni-create.xml +++ b/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vf-operation-uni-create.xml @@ -3,6 +3,146 @@ 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='sotn-vf-operation-uni-create' mode='sync'>
<block atomic="true">
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="There are no VNFs in MD-SAL" />
+ </return>
+ </outcome>
+ </switch>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test="`$service-data.vnfs.vnf[$idx].vnf-id == $vf-module-topology-operation-input.vnf-information.vnf-id`">
+ <outcome value='true'>
+ <set>
+ <parameter name='vnf-index' value='`$idx`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$vnf-index`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf id not found in service-data" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='vf-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='vf-index' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length`' />
+ </set>
+ <for index='idx' start='0' end='`$vf-index`' >
+ <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id == $vf-module-topology-operation-input.vf-module-information.vf-module-id`">
+ <outcome value='true'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$idx].vf-module-id already found in service-data" />
+ </return>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <for index="idx" start="0" end="`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param_length`">
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$idx].name`'/>
+ <parameter name="regex" value="_"/>
+ <parameter name="ctx_memory_result_key" value="param-prefix"/>
+ </execute>
+ <set>
+ <parameter name="`vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$idx].name`" value='`$param-prefix[$param-prefix_length -1]`'/>
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='vf-module-request-input.' value='`$vf-module-topology-operation-input.vf-module-request-input.`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-get-vf-module-uni-param' mode='sync' ></call>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length' value='`$vf-index + 1`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='generateUUID' >
+ <parameter name="ctx-destination" value="prop.vf-id"/>
+ </execute>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-index].vf-module-id' value='`$prop.vf-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-index].vf-module-data.sdnc-request-header.' value='`$vf-module-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-index].vf-module-data.request-information.' value='`$vf-module-topology-operation-input.request-information.`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-index].vf-module-data.service-information.' value='`$vf-module-topology-operation-input.service-information.`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-index].vf-module-data.vnf-information.' value='`$vf-module-topology-operation-input.vnf-information.`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-index].vf-module-data.vf-module-information.' value='`$vf-module-topology-operation-input.vf-module-information.`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-index].vf-module-data.vf-module-request-input.' value='`$vf-module-topology-operation-input.vf-module-request-input.`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-index].vf-module-data.vf-module-topology.' value='`$tmp.vf-module-topology.`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module_length' value='`$vf-index+1`' />
+ </set>
+ <set>
+ <parameter name='vf-module-id' value='`$prop.vf-id`'/>
+ <parameter name='vf-module-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vf-module-topology-operation-input.service-information.service-instance-id
+ + '/service-data/vnfs/vnf/'
+ + $service-data.vnfs.vnf[$vnf-index].vnf-id
+ + '/vnf-data/vf-modules/vf-module/'
+ + $vf-module-topology-operation-input.vf-module-information.vf-module-id
+ + '/vf-module-data/vf-module-topology/'`"/>
+ <parameter name='vnf-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vf-module-topology-operation-input.service-information.service-instance-id
+ + '/service-data/vnfs/vnf/'
+ + $service-data.vnfs.vnf[$vnf-index].vnf-id
+ + '/vnf-data/vnf-topology/'`"/>
+ <parameter name='service-object-path'
+ value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vf-module-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-index].vf-module-data.vf-module-level-oper-status.order-status' value='Created' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-index].vf-module-data.vf-module-level-oper-status.last-rpc-action' value='`$vf-module-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-index].vf-module-data.vf-module-level-oper-status.last-action' value='`$vf-module-topology-operation-input.sdnc-request-header.request-action`' />
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='uni'
+ key='uni.id = $prop.vf-id' >
+ <parameter name="id" value="`$prop.vf-id`" />
+ <parameter name="tpId" value='`$prop.uni.tpId`' />
+ <parameter name='cVLAN' value='`$prop.uni.vlanId`' />
+ <parameter name='operational-status' value='Created' />
+ <parameter name='model-customization-id' value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`' />
+ <parameter name='model-invariant-id' value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-invariant-uuid`' />
+ <parameter name='model-version-id' value='`$vf-module-topology-operation-input.vf-module-information.onap-model-information.model-uuid`' />
+ <parameter name='selflink' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $vf-module-topology-operation-input.service-information.service-instance-id + '/service-data/vnfs/vnf/' + $service-data.vnfs.vnf[$vnf-index].vnf-id + '/vnf-data/vf-modules/vf-module/' + $prop.vf-id + '/vf-module-data/'` " />
+ </save>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="'generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id'
+ AND depth = '0'"
+ pfx='tmp.aai.generic-vnf' local-only='false' >
+ <block>
+ <set>
+ <parameter name="tmp.relationship_length" value='`$tmp.aai.generic-vnf.relationship-list.relation_length`'/>
+ </set>
+ </block>
+ </get-resource>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='generic-vnf:relationship-list'
+ key='generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id'
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="`relationship-list.relationship[$tmp.relationship_length].related-to`" value="uni" />
+ <parameter name="`relationship-list.relationship[$tmp.relationship_length].related-link`" value="`'/network/unis/uni/' + $prop.vf-id`" />
+ <parameter name="`relationship-list.relationship[$tmp.relationship_length].relationship-data[0].relationship-key`" value="id" />
+ <parameter name="`relationship-list.relationship[$tmp.relationship_length].relationship-data[0].relationship-value`" value="`$prop.vf-id`" />
+ </save>
<return status='success'>
<parameter name="ack-final-indicator" value="Y" />
<parameter name="error-code" value="200" />
diff --git a/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vnf-topology-operation-underlay-activate.xml b/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vnf-topology-operation-underlay-activate.xml index 28faefee..69344e8a 100644 --- a/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vnf-topology-operation-underlay-activate.xml +++ b/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vnf-topology-operation-underlay-activate.xml @@ -1,8 +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='GENERIC-RESOURCE-API' version='${project.version}'>
+ 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='sotn-vnf-topology-operation-underlay-activate' mode='sync'>
<block atomic="true">
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='vidx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <block>
+ <switch test="`$service-data.vnfs.vnf[$vidx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`">
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.vidx' value='`$vidx`' />
+ <parameter name='ctx.vnf-data.' value='`$service-data.vnfs.vnf[$vidx].`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.order-status`'>
+ <outcome value='Created'>
+ <block atomic="true"></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="`'VNF is not in appropriate state for activate. Current state is ' + $service-data.vnfs.vnf[$tmp.nidx].vnf-data.vnf-level-oper-status.order-status`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' />
+ </set>
+ <set>
+ <parameter name='vnfId' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name="vnf-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $vnf-topology-operation-input.service-information.service-instance-id + '/service-data/vnfs/vnf/' + $vnf-topology-operation-input.vnf-information.vnf-id + '/vnf-data/'` " />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.order-status' value='Active' />
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $vnfId" >
+ <parameter name="orchestration-status" value="Active" />
+ <parameter name="vnf-type" value="some vnf-type" />
+ </update>
<return status='success'>
<parameter name="ack-final-indicator" value="Y" />
<parameter name="error-code" value="200" />
diff --git a/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vnf-topology-operation-underlay-create.xml b/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vnf-topology-operation-underlay-create.xml index 1f7b0138..ba1c3cdd 100644 --- a/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vnf-topology-operation-underlay-create.xml +++ b/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vnf-topology-operation-underlay-create.xml @@ -1,8 +1,109 @@ <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='sotn-vnf-topology-operation-underlay-create' mode='sync'>
+ 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='vnf-topology-operation-vpn-site-resource-create' mode='sync'>
<block atomic="true">
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='vnf-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='vnf-index' value='`$service-data.vnfs.vnf_length`' />
+ </set>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$vnf-topology-operation-input.vnf-information.vnf-id == $service-data.vnfs.vnf[$idx].vnf-id`'>
+ <outcome value='true'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'VNF id ' + $service-data.vnfs.vnf[$idx].vnf-id
+ + ' already exists, and has order status ' + $service-data.vnfs.vnf[$idx].vnf-data.vnf-level-oper-status.order-status`" />
+ </return>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <for index="idx" start="0" end="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`">
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name`'/>
+ <parameter name="regex" value="_"/>
+ <parameter name="ctx_memory_result_key" value="param-prefix"/>
+ </execute>
+ <set>
+ <parameter name="`vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name`" value='`$param-prefix[$param-prefix_length -1]`'/>
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='vnf-request-input.' value='`$vnf-topology-operation-input.vnf-request-input.`' />
+ </set>
+ <for index="idx" start="0" end="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`">
+ <block>
+ <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'name'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.vnfName' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf_length' value='`$vnf-index + 1`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='generateUUID' >
+ <parameter name="ctx-destination" value="prop.vnf-id"/>
+ </execute>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-id' value='`$prop.vnf-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.' value='$vnf-topology-operation-input.vnf-information.' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.' value='$vnf-topology-operation-input.vnf-request-input.' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.vnf-id' value='`$prop.vnf-id`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='Created' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <set>
+ <parameter name='vnfId' value='`$prop.vnf-id`' />
+ <parameter name="vnf-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $vnf-topology-operation-input.service-information.service-instance-id + '/service-data/vnfs/vnf/' + $prop.vnf-id + '/vnf-data/'` " />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key='generic-vnf.vnf-id = $prop.vnf-id' >
+ <parameter name="orchestration-status" value="Created" />
+ <parameter name="in-maint" value = "true" />
+ <parameter name="vnf-type" value='`$prop.vnfName`' />
+ <parameter name="vnf-name" value = "`$prop.vnfName`"/>
+ <parameter name="model-invariant-id" value = "`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`"/>
+ <parameter name="model-version-id" value = "`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`"/>
+ <parameter name="model-customization-id" value = "`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`"/>
+ </save>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='service-instance:relationship-list'
+ key='service-instance.service-instance-id = $service-data.service-information.service-instance-id
+ AND customer.global-customer-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.global-customer-id
+ AND service-subscription.service-type = $service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.subscription-service-type'
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`'/network/generic-vnfs/generic-vnf/' + $prop.vnf-id`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="generic-vnf.vnf-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$prop.vnf-id`" />
+ <!--key='service-instance.service-instance-id = $service-data.service-information.service-instance-id -->
+ <!--key='service-instance.service-instance-id = $service-data.service-instance-id -->
+ </save>
<return status='success'>
<parameter name="ack-final-indicator" value="Y" />
<parameter name="error-code" value="200" />
diff --git a/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vnf-topology-operation-underlay-deactivate.xml b/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vnf-topology-operation-underlay-deactivate.xml index 28acdbf6..139f12e8 100644 --- a/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vnf-topology-operation-underlay-deactivate.xml +++ b/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vnf-topology-operation-underlay-deactivate.xml @@ -1,8 +1,84 @@ <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}'>
+ 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='sotn-vnf-topology-operation-underlay-deactivate' mode='sync'>
<block atomic="true">
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value='0'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='vidx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <block>
+ <switch test="`$service-data.vnfs.vnf[$vidx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vidx' value='`$vidx`' />
+ <parameter name='ctx.vnf-data.' value='`$service-data.vnfs.vnf[$vidx].`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$tmp.vidx`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.order-status`'>
+ <outcome value='Active'>
+ <block atomic="true"></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="`'VNF is not in appropriate state for activate. Current state is ' + $service-data.vnfs.vnf[$tmp.nidx].vnf-data.vnf-level-oper-status.order-status`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <!--parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' /-->
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' />
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' />
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' />
+ </set>
+ <set>
+ <parameter name='vnfId' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name="vnf-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $vnf-topology-operation-input.service-information.service-instance-id + '/service-data/vnfs/vnf/' + $vnf-topology-operation-input.vnf-information.vnf-id + '/vnf-data/'` " />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.order-status' value='PendingDelete' />
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $vnfId" >
+ <parameter name="orchestration-status" value="PendingDelete" />
+ <parameter name="vnf-type" value="some vnf-type" />
+ </update>
<return status='success'>
<parameter name="ack-final-indicator" value="Y" />
<parameter name="error-code" value="200" />
diff --git a/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vnf-topology-operation-underlay-delete.xml b/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vnf-topology-operation-underlay-delete.xml index 7c106ee8..130eee23 100644 --- a/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vnf-topology-operation-underlay-delete.xml +++ b/platform-logic/generic-resource-api/src/main/xml/sotn_nni/GENERIC-RESOURCE-API_sotn-vnf-topology-operation-underlay-delete.xml @@ -1,8 +1,93 @@ <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}'>
+ 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='sotn-vnf-topology-operation-underlay-delete' mode='sync'>
<block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' >
+ <parameter name="vnf-topology-operation-input.vnf-information.vnf-id" value="$vnf-topology-operation-input.vnf-information.vnf-id"/>
+ </execute>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='nidx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test="`$service-data.vnfs.vnf[$nidx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`">
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.nidx' value='`$nidx`' />
+ <parameter name='ctx.vnf-data.' value='`$service-data.vnfs.vnf[$nidx].vnf-data.`' />
+ </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="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf[$tmp.nidx].vnf-data.vnf-level-oper-status.order-status`'>
+ <outcome value='PendingDelete'>
+ <block atomic="true"></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="`'VNF is not in appropriate state for activate. Current state is ' + $service-data.vnfs.vnf[$tmp.nidx].vnf-data.vnf-level-oper-status.order-status`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='prop.vnfidxLen' value='`0`' />
+ </set>
+ <for index='lidx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <block atomic="true">
+ <switch test="`$service-data.vnfs.vnf[$lidx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`">
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='service-data.vnfs.vnf[$prop.vnfidxLen].vnf-id' value='`$service-data.vnfs.vnf[$lidx].vnf-id`' />
+ <parameter name='service-data.vnfs.vnf[$prop.vnfidxLen].vnf-data.' value='`$service-data.vnfs.vnf[$lidx].vnf-data.`' />
+ </set>
+ <set>
+ <parameter name='prop.vnfidxLen' value='`$prop.vnfidxLen + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name="service-data.vnfs.vnf_length" value='`$prop.vnfidxLen`'/>
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$prop.vnfidxLen]." value=""/>
+ </set>
+ <set>
+ <parameter name='vnfId' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='vnf-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vnf-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'` " />
+ </set>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $vnfId" >
+ <parameter name="orchestration-status" value="PendingDelete" />
+ <parameter name="vnf-type" value="some vnf-type" />
+ </delete>
<return status='success'>
<parameter name="ack-final-indicator" value="Y" />
<parameter name="error-code" value="200" />
|