summaryrefslogtreecommitdiffstats
path: root/platform-logic/generic-resource-api/src/main/xml
diff options
context:
space:
mode:
authorgaurav <gaurav.agrawal@huawei.com>2018-08-10 16:24:06 +0530
committergaurav <gaurav.agrawal@huawei.com>2018-08-10 16:24:06 +0530
commit18ccf4d7bb32f355d274abfb25100c9a54ecd9b7 (patch)
tree1c3d38ee27fd9e6a540dbdf904e5a59807ac425b /platform-logic/generic-resource-api/src/main/xml
parentb324322c4d885c45e6cb0843ed769203969ac041 (diff)
SDWAN VPN DG addition
Updates include: - Addition of sdwan connectivity resource DG - Hooking the same to main DG Change-Id: Icb629089ec3f5a4983eabe3168523b24e2afd275 Issue-ID: SDNC-357 Signed-off-by: Gaurav Agrawal <gaurav.agrawal@huawei.com> Former-commit-id: ad341b6b20b613e9861bbc6c0bd9f1bceb2e3d7e
Diffstat (limited to 'platform-logic/generic-resource-api/src/main/xml')
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation.xml14
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-network-topology-operation-activate.xml227
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-network-topology-operation-create.xml105
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-network-topology-operation-deactivate.xml153
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-network-topology-operation-delete.xml34
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-network-input.xml56
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-sdwan-network-input-parameters.xml305
7 files changed, 868 insertions, 26 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 fbd3775a..88377fc5 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
@@ -43,6 +43,9 @@
<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`'>
@@ -184,6 +187,9 @@
<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`'>
@@ -361,6 +367,9 @@
<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>
@@ -373,6 +382,9 @@
<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>
@@ -398,4 +410,4 @@
</return>
</block>
</method>
-</service-logic> \ No newline at end of file
+</service-logic>
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-network-topology-operation-activate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-network-topology-operation-activate.xml
new file mode 100644
index 00000000..e9880582
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-network-topology-operation-activate.xml
@@ -0,0 +1,227 @@
+<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='sdwan-network-topology-operation-activate' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-sdwan-network-input-parameters' mode='sync' ></call>
+ <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="sdwan-network-topology-operation-activate"/>
+ <parameter name="field3" value="SDWAN-Activate"/>
+ </record>
+ <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>
+ <for index='idx' start='0' end='`$ctx.network-data.network-request-input.network-input-parameters.param_length`' >
+ <block>
+ <switch test="`$ctx.network-data.network-request-input.network-input-parameters.param[$idx].name == 'name'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.name' value='`$ctx.network-data.network-request-input.network-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$ctx.network-data.network-request-input.network-input-parameters.param[$idx].name == 'topology'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.topology' value='`$ctx.network-data.network-request-input.network-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="esr-thirdparty-sdnc"
+ key="esr-thirdparty-sdnc.thirdparty-sdnc-id = 'SDWAN-Controller' 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.openecomp.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>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-subscription"
+ key= 'service-subscription.service-type = $service-data.networks.network[$tmp.nidx].network-data.service-information.subscription-service-type
+ AND customer.global-customer-id = $service-data.networks.network[$tmp.nidx].network-data.service-information.global-customer-id'
+ force="true" pfx="tmp.AnAI-data">
+ <switch test='`$tmp.AnAI-data.temp-ub-sub-account-id`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name='prop.customer-id' value='`$ctx.network-data.service-information.global-customer-id`' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-subscription"
+ key= 'service-subscription.service-type = $service-data.networks.network[$tmp.nidx].network-data.service-information.subscription-service-type
+ AND customer.global-customer-id = $service-data.networks.network[$tmp.nidx].network-data.service-information.global-customer-id'>
+ <parameter name='temp-ub-sub-account-id' value='`$prop.customer-id`' />
+ </save>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/sdwan-tenant.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/controller/campus/v1/baseservice/tenanats'`" />
+ <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="put"/>
+ <parameter name="responsePrefix" value="tenant-result"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.openecomp.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`" />
+ </execute>
+ <set>
+ <parameter name='prop.tenant-id' value='`$tenant-result.data.tenantId`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/controller/campus/v1/baseservice/tenanats/authorization/' + $prop.tenant-id`" />
+ <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="put"/>
+ <parameter name="responsePrefix" value="tenant-result"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.openecomp.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`" />
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.tenant-id' value='`$tmp.AnAI-data.temp-ub-sub-account-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </get-resource>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/sdwan-network-orchestration.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/controller/campus/v1/sdwan/net/network-orchestration-resources'`" />
+ <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="put"/>
+ <parameter name="responsePrefix" value="orchestration-result"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.openecomp.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`" />
+ </execute>
+ </block>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/sdwan-vpn.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/controller/campus/v1/sdwan/overlay-network/vpn'`" />
+ <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="post"/>
+ <parameter name="responsePrefix" value="vpn-result"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.openecomp.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`" />
+ </execute>
+ <set>
+ <parameter name='prop.vpn-id' value='`$vpn-result.id`' />
+ <parameter name='prop.vpn1Id' value='`$vpn-result.id`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/sdwan-vpn-topology.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/controller/campus/v1/sdwan/overlay-network/' + $prop.vpn-id + '/topology'`" />
+ <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="post"/>
+ <parameter name="responsePrefix" value="vpn-result"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.openecomp.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`" />
+ </execute>
+ </block>
+ <set>
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$network-topology-operation-input.network-request-input.network-input-parameters.param_length].name' value='tenant-id' />
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$network-topology-operation-input.network-request-input.network-input-parameters.param_length].value' value='`$prop.tenant-id`' />
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$network-topology-operation-input.network-request-input.network-input-parameters.param_length + 1].name' value='vpn-id' />
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$network-topology-operation-input.network-request-input.network-input-parameters.param_length + 1].value' value='`$prop.vpn-id`' />
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param_length' value='`$network-topology-operation-input.network-request-input.network-input-parameters.param_length + 2`' />
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.sdnc-request-header.' value='`$network-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.request-information.' value='`$network-topology-operation-input.request-information.`' />
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.service-information.' value='`$network-topology-operation-input.service-information.`' />
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-information.' value='`$network-topology-operation-input.network-information.`' />
+ </set>
+ <set>
+ <parameter name='networkId' value='`$network-topology-operation-input.network-information.network-id`' />
+ <parameter name="network-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $network-topology-operation-input.service-information.service-instance-id + '/service-data/networks/network/' + $network-topology-operation-input.network-information.network-id + '/network-data/'` " />
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status' value='Active' />
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.last-rpc-action' value='`$network-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.last-action' value='`$network-topology-operation-input.request-information.request-action`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='sdwan-vpn'
+ key='sdwan-vpn.id = $network-topology-operation-input.network-information.network-id' >
+ <parameter name='id' value='`$network-topology-operation-input.network-information.network-id`' />
+ <parameter name='operational-status' value='Active' />
+ <parameter name='tenanatId' value='`$prop.tenant-id`' />
+ <parameter name='vpn-id' value='`$prop.vpn-id`' />
+ </update>
+ <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_sdwan-network-topology-operation-create.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-network-topology-operation-create.xml
new file mode 100644
index 00000000..73ba3bcf
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-network-topology-operation-create.xml
@@ -0,0 +1,105 @@
+<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='sdwan-network-topology-operation-create' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-sdwan-network-input-parameters' mode='sync' ></call>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='generateUUID' >
+ <parameter name="ctx-destination" value="prop.sdwan.network-id"/>
+ </execute>
+ <for index="idx" start="0" end="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`">
+ <block>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'name'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.name' value='`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'topology'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.topology' value='`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test='`$service-data.networks.network_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='nidx' value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block>
+ <set>
+ <parameter name='nidx' value='`$service-data.networks.network_length`' />
+ </set>
+ <for index='idx' start='0' end='`$nidx`' >
+ <switch test="`$service-data.networks.network[$idx].network-id == $network-topology-operation-input.network-information.network-id`">
+ <outcome value='true'>
+ <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 already found in service-data" />
+ </return>
+ </outcome>
+ </switch>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <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="sdwan-network-topology-operation-create"/>
+ <parameter name="field3" value="SDWAN-Config"/>
+ </record>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-id' value='`$prop.sdwan.network-id`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.sdnc-request-header.' value='`$network-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.request-information.' value='`$network-topology-operation-input.request-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.service-information.' value='`$network-topology-operation-input.service-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-information.' value='`$network-topology-operation-input.network-information.`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-request-input.' value='`$network-topology-operation-input.network-request-input.`' />
+ <parameter name='service-data.networks.network_length' value='`$nidx+1`' />
+ </set>
+ <set>
+ <parameter name='networkId' value='`$prop.sdwan.network-id`' />
+ <parameter name="network-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $network-topology-operation-input.service-information.service-instance-id + '/service-data/networks/network/' + $prop.sdwan.network-id + '/network-data/'` " />
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.order-status' value='Created' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.last-rpc-action' value='`$network-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.networks.network[$nidx].network-data.network-level-oper-status.last-action' value='`$network-topology-operation-input.request-information.request-action`' />
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='sdwan-vpn'
+ key='sdwan-vpn.id = $prop.sdwan.network-id' >
+ <parameter name='id' value='`$prop.sdwan.network-id`' />
+ <parameter name='name' value='`$prop.name`' />
+ <parameter name='topology' value='`$prop.topology`' />
+ <parameter name='operational-status' value='Created' />
+ <parameter name='model-customization-id' value='`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`' />
+ <parameter name='model-invariant-id' value='`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`' />
+ <parameter name='model-version-id' value='`$network-topology-operation-input.network-information.onap-model-information.model-uuid`' />
+ <parameter name='selflink' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $network-topology-operation-input.service-information.service-instance-id + '/service-data/networks/network/' + $prop.sdwan.network-id + '/network-data/'` " />
+ </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.networks.network[$nidx].network-data.service-information.global-customer-id
+ AND service-subscription.service-type = $service-data.networks.network[$nidx].network-data.service-information.subscription-service-type'
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="sdwan-vpn" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`'/network/sdwan-vpns/sdwan-vpn/' + $prop.sdwan.network-id`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="sdwan-vpn.id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$prop.sdwan.network-id`" />
+ </save>
+ <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_sdwan-network-topology-operation-deactivate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-network-topology-operation-deactivate.xml
new file mode 100644
index 00000000..19c027db
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-network-topology-operation-deactivate.xml
@@ -0,0 +1,153 @@
+<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='sdwan-network-topology-operation-deactivate' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-sdwan-network-input-parameters' mode='sync' ></call>
+ <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="sdwan-network-topology-operation-deactivate"/>
+ <parameter name="field3" value="SDWAN-Deactivate"/>
+ </record>
+ <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>
+ <for index='idx' start='0' end='`$ctx.network-data.network-request-input.network-input-parameters.param_length`' >
+ <block>
+ <switch test="`$ctx.network-data.network-request-input.network-input-parameters.param[$idx].name == 'name'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.name' value='`$ctx.network-data.network-request-input.network-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$ctx.network-data.network-request-input.network-input-parameters.param[$idx].name == 'topology'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.topology' value='`$ctx.network-data.network-request-input.network-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$ctx.network-data.network-request-input.network-input-parameters.param[$idx].name == 'vpn-id'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.vpn-id' value='`$ctx.network-data.network-request-input.network-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$ctx.network-data.network-request-input.network-input-parameters.param[$idx].name == 'tenant-id'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.tenant-id' value='`$ctx.network-data.network-request-input.network-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="esr-thirdparty-sdnc"
+ key="esr-thirdparty-sdnc.thirdparty-sdnc-id = 'SDWAN-Controller' 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.openecomp.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>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/controller/campus/v1/sdwan/overlay-network/' + $prop.vpn-id + '/topology'`" />
+ <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="delete"/>
+ <parameter name="responsePrefix" value="vpn-result"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.openecomp.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`" />
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/sdwan-vpn-delete.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/controller/campus/v1/sdwan/overlay-network/vpn/action/batch-delete'`" />
+ <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="post"/>
+ <parameter name="responsePrefix" value="vpn-result"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.openecomp.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`" />
+ </execute>
+ <set>
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.sdnc-request-header.' value='`$network-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.request-information.' value='`$network-topology-operation-input.request-information.`' />
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.service-information.' value='`$network-topology-operation-input.service-information.`' />
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-information.' value='`$network-topology-operation-input.network-information.`' />
+ </set>
+ <set>
+ <parameter name='networkId' value='`$network-topology-operation-input.network-information.network-id`' />
+ <parameter name="network-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $network-topology-operation-input.service-information.service-instance-id + '/service-data/networks/network/' + $network-topology-operation-input.network-information.network-id + '/network-data/'` " />
+ </set>
+ <set>
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status' value='PendingDelete' />
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.last-rpc-action' value='`$network-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.last-action' value='`$network-topology-operation-input.request-information.request-action`' />
+ </set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='sdwan-vpn'
+ key='sdwan-vpn.id = $network-topology-operation-input.network-information.network-id' >
+ <parameter name='id' value='`$network-topology-operation-input.network-information.network-id`' />
+ <parameter name='operational-status' value='PendingDelete' />
+ </update>
+ <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_sdwan-network-topology-operation-delete.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-network-topology-operation-delete.xml
new file mode 100644
index 00000000..8363b688
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-network-topology-operation-delete.xml
@@ -0,0 +1,34 @@
+<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='sdwan-network-topology-operation-delete' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-sdwan-network-input-parameters' mode='sync' ></call>
+ <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="sdwan-network-topology-operation-delete"/>
+ <parameter name="field3" value="SDWAN-Delete"/>
+ </record>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource='sdwan-vpn'
+ key='sdwan-vpn.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>
+ <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_validate-network-input.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-network-input.xml
index c24fadbb..87cf4489 100644
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-network-input.xml
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-network-input.xml
@@ -172,8 +172,8 @@
<outcome value=''>
<block atomic="true">
<get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key='SELECT * from SERVICE_MODEL WHERE service_uuid = $service-data.service-information.onap-model-information.model-uuid'
- pfx='service-model'>
+ key='SELECT * from SERVICE_MODEL WHERE service_uuid = $service-data.service-information.onap-model-information.model-uuid'
+ pfx='service-model'>
<outcome value='not-found'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
@@ -190,14 +190,14 @@
</outcome>
</get-resource>
<get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key='SELECT * from NETWORK_MODEL WHERE customization_uuid = $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid
+ key='SELECT * from NETWORK_MODEL WHERE customization_uuid = $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid
and service_uuid = $service-data.service-information.onap-model-information.model-uuid'
- pfx='network-model'>
+ pfx='network-model'>
<outcome value='not-found'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'No network model found for customization UUID '
+ <parameter name="error-message" value="`'No network model found for customization UUID '
+ $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid +
' and model-uuid ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
</return>
@@ -206,7 +206,7 @@
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'No network model found for customization UUID '
+ <parameter name="error-message" value="`'No network model found for customization UUID '
+ $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid +
' and model-uuid ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
</return>
@@ -217,8 +217,8 @@
<outcome value='Other'>
<block atomic="true">
<get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key='SELECT * from SERVICE_MODEL WHERE service_uuid = $network-topology-operation-input.service-information.onap-model-information.model-uuid'
- pfx='service-model'>
+ key='SELECT * from SERVICE_MODEL WHERE service_uuid = $network-topology-operation-input.service-information.onap-model-information.model-uuid'
+ pfx='service-model'>
<outcome value='not-found'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
@@ -235,14 +235,14 @@
</outcome>
</get-resource>
<get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key='SELECT * from NETWORK_MODEL WHERE customization_uuid = $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid
+ key='SELECT * from NETWORK_MODEL WHERE customization_uuid = $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid
and service_uuid = $network-topology-operation-input.service-information.onap-model-information.model-uuid'
- pfx='network-model'>
+ pfx='network-model'>
<outcome value='not-found'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'No network model found for customization UUID '
+ <parameter name="error-message" value="`'No network model found for customization UUID '
+ $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid +
' and model-uuid ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
</return>
@@ -251,7 +251,7 @@
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'No network model found for customization UUID '
+ <parameter name="error-message" value="`'No network model found for customization UUID '
+ $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid +
' and model-uuid ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
</return>
@@ -275,6 +275,9 @@
<outcome value='activate'>
<block atomic="true">
<switch test='`$network-topology-operation-input.request-information.request-action`'>
+ <outcome value='ActivateSDWANConnectivityInstance'>
+ <block atomic="true"></block>
+ </outcome>
<outcome value='ActivateSOTNConnectivityInstance'>
<block atomic="true"></block>
</outcome>
@@ -341,8 +344,8 @@
<outcome value=''>
<block atomic="true">
<get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key='SELECT * from SERVICE_MODEL WHERE service_uuid = $service-data.service-information.onap-model-information.model-uuid'
- pfx='service-model'>
+ key='SELECT * from SERVICE_MODEL WHERE service_uuid = $service-data.service-information.onap-model-information.model-uuid'
+ pfx='service-model'>
<outcome value='not-found'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
@@ -359,14 +362,14 @@
</outcome>
</get-resource>
<get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key='SELECT * from NETWORK_MODEL WHERE customization_uuid = $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid
+ key='SELECT * from NETWORK_MODEL WHERE customization_uuid = $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid
and service_uuid = $service-data.service-information.onap-model-information.model-uuid'
- pfx='network-model'>
+ pfx='network-model'>
<outcome value='not-found'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'No network model found for customization UUID '
+ <parameter name="error-message" value="`'No network model found for customization UUID '
+ $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid +
' and model-uuid ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
</return>
@@ -375,7 +378,7 @@
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'No network model found for customization UUID '
+ <parameter name="error-message" value="`'No network model found for customization UUID '
+ $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid +
' and model-uuid ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
</return>
@@ -386,8 +389,8 @@
<outcome value='Other'>
<block atomic="true">
<get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key='SELECT * from SERVICE_MODEL WHERE service_uuid = $network-topology-operation-input.service-information.onap-model-information.model-uuid'
- pfx='service-model'>
+ key='SELECT * from SERVICE_MODEL WHERE service_uuid = $network-topology-operation-input.service-information.onap-model-information.model-uuid'
+ pfx='service-model'>
<outcome value='not-found'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
@@ -404,14 +407,14 @@
</outcome>
</get-resource>
<get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
- key='SELECT * from NETWORK_MODEL WHERE customization_uuid = $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid
+ key='SELECT * from NETWORK_MODEL WHERE customization_uuid = $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid
and service_uuid = $network-topology-operation-input.service-information.onap-model-information.model-uuid'
- pfx='network-model'>
+ pfx='network-model'>
<outcome value='not-found'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'No network model found for customization UUID '
+ <parameter name="error-message" value="`'No network model found for customization UUID '
+ $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid +
' and model-uuid ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
</return>
@@ -420,7 +423,7 @@
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
- <parameter name="error-message" value="`'No network model found for customization UUID '
+ <parameter name="error-message" value="`'No network model found for customization UUID '
+ $network-topology-operation-input.network-information.onap-model-information.model-customization-uuid +
' and model-uuid ' + $network-topology-operation-input.service-information.onap-model-information.model-uuid`" />
</return>
@@ -524,6 +527,9 @@
<outcome value='deactivate'>
<block atomic="true">
<switch test='`$network-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeactivateSDWANConnectivityInstance'>
+ <block atomic="true"></block>
+ </outcome>
<outcome value='DeactivateSOTNConnectivityInstance'>
<block atomic="true"></block>
</outcome>
@@ -587,4 +593,4 @@
</return>
</block>
</method>
-</service-logic> \ No newline at end of file
+</service-logic>
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-sdwan-network-input-parameters.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-sdwan-network-input-parameters.xml
new file mode 100644
index 00000000..478fe4d0
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-sdwan-network-input-parameters.xml
@@ -0,0 +1,305 @@
+<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='validate-sdwan-network-input-parameters' mode='sync'>
+ <block atomic="true">
+ <switch test='`$network-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$network-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='create'>
+ <block atomic="true">
+ <switch test='`$network-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateSDWANConnectivityInstance'>
+ <block atomic="true">
+ <for index="i" start="0" end="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`">
+ <block>
+ <set>
+ <parameter name='tmp.name' value='' />
+ <parameter name='tmp.value' value='' />
+ </set>
+ <set>
+ <parameter name='tmp.name' value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$i].name`"/>
+ <parameter name='tmp.value' value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$i].value`"/>
+ </set>
+ <switch test="`$tmp.name`">
+ <outcome value='name'>
+ <switch test="`$tmp.value`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='topology'>
+ <switch test="`$tmp.value`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-request-input.network-input-parameters.param '+ $tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <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-input-parameters.param[' + $i + ']' + '.name is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </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="request-information.request-action is required to be SOTN CreateVPNNetworkInstance for svc-action=create" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='activate'>
+ <switch test='`$network-topology-operation-input.request-information.request-action`'>
+ <outcome value='ActivateSDWANConnectivityInstance'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' >
+ <parameter name="network-topology-operation-input.network-information.network-id" value="$network-topology-operation-input.network-information.network-id"/>
+ </execute>
+ <switch test="`$network-topology-operation-input.network-information.network-id`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <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'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.nidx' value='`$nidx`' />
+ <parameter name='ctx.network-data.' value='`$service-data.networks.network[$nidx].network-data.`' />
+ </set>
+ </block>
+ </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>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.networks.network[$tmp.nidx].network-data.network-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="`'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='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is required to be SOTN ActivateVPNNetworkInstance for svc-action=activate" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='deactivate'>
+ <switch test='`$network-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeactivateSDWANConnectivityInstance'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' >
+ <parameter name="network-topology-operation-input.network-information.network-id" value="$network-topology-operation-input.network-information.network-id"/>
+ </execute>
+ <switch test="`$network-topology-operation-input.network-information.network-id`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <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'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.nidx' value='`$nidx`' />
+ <parameter name='ctx.network-data.' value='`$service-data.networks.network[$nidx].network-data.`' />
+ </set>
+ </block>
+ </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>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.networks.network[$tmp.nidx].network-data.network-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="`'Network is not in appropriate state for deactivate. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`" />
+ </return>
+ </outcome>
+ </switch>
+ </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="request-information.request-action is required to be SOTN DeactivateVPNNetworkInstance for svc-action=deactivate" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='delete'>
+ <switch test='`$network-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteSDWANConnectivityInstance'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' >
+ <parameter name="network-topology-operation-input.network-information.network-id" value="$network-topology-operation-input.network-information.network-id"/>
+ </execute>
+ <switch test="`$network-topology-operation-input.network-information.network-id`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <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'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.nidx' value='`$nidx`' />
+ <parameter name='ctx.network-data.' value='`$service-data.networks.network[$nidx].network-data.`' />
+ </set>
+ </block>
+ </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>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.networks.network[$tmp.nidx].network-data.network-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="`'Network is not in appropriate state for delete. Current state is ' + $service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`" />
+ </return>
+ </outcome>
+ </switch>
+ </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="request-information.request-action is required to be SOTN DeleteVPNNetworkInstance for svc-action=delete" />
+ </return>
+ </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="`$network-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>