summaryrefslogtreecommitdiffstats
path: root/platform-logic/generic-resource-api/src/main/xml
diff options
context:
space:
mode:
authorGaurav Agrawal <gaurav.agrawal@huawei.com>2017-09-28 19:38:52 +0530
committerGaurav Agrawal <gaurav.agrawal@huawei.com>2017-09-28 19:38:52 +0530
commit4d9351b103c6de276a716df637eac181584e3b95 (patch)
treef5754e801e590fe8e794ce91a4c7424ac4ff14ae /platform-logic/generic-resource-api/src/main/xml
parentbe72599d4037a6968cfba75d824c5c14a57bd556 (diff)
Update DG network-topology-operation-deactivate
Following changes are included: 1) Handle l2 and l3 dci. 2) Fetch 3rd parth controller information using site-id. 3) Fetch siteId from parameter list. Change-Id: Ibd6b7520f96dbadcb2ffd440fe9687e86d7e558f Issue-Id: SDNC-104 Signed-off-by: Gaurav Agrawal <gaurav.agrawal@huawei.com> Former-commit-id: 68505f52197cc6d7bbc804c9b9f38f3b8886fe66
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_dci-connects-network-topology-operation-deactivate.xml95
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_l3-dci-connects-network-topology-operation-deactivate.xml69
2 files changed, 95 insertions, 69 deletions
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_dci-connects-network-topology-operation-deactivate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_dci-connects-network-topology-operation-deactivate.xml
new file mode 100644
index 00000000..d9c3fbb3
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_dci-connects-network-topology-operation-deactivate.xml
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module="GENERIC-RESOURCE-API" version="${project.version}">
+ <method rpc="network-topology-operation-deactivate" mode="sync">
+ <block atomic="true">
+ <call module="GENERIC-RESOURCE-API" rpc="validate-network-input-parameters" mode="sync" />
+ <for index="idx" start="0" end="`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`">
+ <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].name == 'site1_id'`">
+ <outcome value="true">
+ <set>
+ <parameter name="prop.dci-connects.id" value="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].value`" />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="dci-connects" key="dci-connects.id AND depth = '1'" pfx="tmp.aai.dci-connects" local-only="false">
+ <outcome value="success">
+ <set>
+ <parameter name="prop.dci-connects.tunnelType" value="`$tmp.aai.dci-connects.dci-connects.serviceType`" />
+ </set>
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ </get-resource>
+ <record plugin="org.openecomp.sdnc.sli.recording.FileRecorder">
+ <parameter name="file" value="/opt/opendaylight/current/data/log/svclogic.log" />
+ <parameter name="Time" value="__TIMESTAMP__" />
+ <parameter name="Method" value="network-topology-operation-deactivate" />
+ <parameter name="SubMethod" value="l3-dci-connects" />
+ <parameter name="L3DciConnectsId" value="`$l3-dci-connects.id`" />
+ </record>
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="esr-thirdparty-sdnc" key="esr-thirdparty-sdnc.thirdparty-sdnc-id = $prop.dci-connects.id AND depth = '1'" pfx="tmp.aai.esr-thirdparty-sdnc" local-only="false">
+ <outcome value="success">
+ <block atomic="true" />
+ </outcome>
+ <outcome value="not-found">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <return status="failure">
+ <parameter name="error-code" value="" />
+ <parameter name="error-message" value="" />
+ </return>
+ </outcome>
+ </get-resource>
+ <set>
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.url" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list[0].esr-system-info.serviceUrl`" />
+ <parameter name="prop.sdncRestApi.templateDir" value="/opt/onap/sdnc/data" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.user" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list[0].esr-system-info.user-name`" />
+ <parameter name="prop.sdncRestApi.thirdpartySdnc.password" value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list[0].esr-system-info.password`" />
+ </set>
+ <switch test="`$prop.dci-connects.tunnelType`">
+ <outcome value="L3-DCI">
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="restapiUrl" value="$prop.sdncRestApi.thirdpartySdnc.url + '/v2.0/l3-dci-connects/' + $prop.l3-dci-connects.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="delete" />
+ <parameter name="responsePrefix" value="restapi-result" />
+ </execute>
+ </outcome>
+ <outcome value="L2-DCI">
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="restapiUrl" value="$prop.sdncRestApi.thirdpartySdnc.url + '/v2.0/l2-dci-connects/' + $prop.l2-dci-connects.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="delete" />
+ <parameter name="responsePrefix" value="restapi-result" />
+ </execute>
+ </outcome>
+ </switch>
+ </block>
+ <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> \ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_l3-dci-connects-network-topology-operation-deactivate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_l3-dci-connects-network-topology-operation-deactivate.xml
deleted file mode 100644
index da74ae8d..00000000
--- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_l3-dci-connects-network-topology-operation-deactivate.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<service-logic
- xmlns='http://www.openecomp.org/sdnc/svclogic'
- xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
- <method rpc='network-topology-operation-deactivate' mode='sync'>
- <block atomic="true">
- <call module='GENERIC-RESOURCE-API' rpc='validate-network-input-parameters' mode='sync' ></call>
- <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="l3-dci-connects"
- key="l3-dci-connects.id AND depth = '1'"
- pfx='tmp.aai.l3-dci-connects' local-only='false' >
- <outcome value='success'>
- <block atomic="true"></block>
- </outcome>
- <outcome value='not-found'>
- <return status='failure'>
- <parameter name='error-code' value='' />
- <parameter name='error-message' value='' />
- </return>
- </outcome>
- <outcome value='Other'>
- <return status='failure'>
- <parameter name='error-code' value='' />
- <parameter name='error-message' value='' />
- </return>
- </outcome>
- </get-resource>
- <record plugin="org.openecomp.sdnc.sli.recording.FileRecorder">
- <parameter name="file" value="/opt/opendaylight/current/data/log/svclogic.log"/>
- <parameter name="Time" value="__TIMESTAMP__"/>
- <parameter name="Method" value="network-topology-operation-deactivate"/>
- <parameter name="SubMethod" value="l3-dci-connects"/>
- <parameter name="L3DciConnectsId" value="`$l3-dci-connects.id`"/>
- </record>
- <set>
- <parameter name='prop.sdncRestApi.thirdpartySdnc.url' value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list[0].esr-system-info.serviceUrl`" />
- <parameter name='prop.sdncRestApi.templateDir' value='/opt/onap/sdnc/data' />
- <parameter name='prop.sdncRestApi.thirdpartySdnc.user' value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list[0].esr-system-info.user-name`" />
- <parameter name='prop.sdncRestApi.thirdpartySdnc.password' value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list[0].esr-system-info.password`" />
- </set>
- <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.l3-dci-connects.id`">
- <outcome value=''>
- <return status='failure'>
- <parameter name='error-code' value='' />
- <parameter name='error-message' value='' />
- </return>
- </outcome>
- <outcome value='true'>
- <set>
- <parameter name='prop.l3-dci-connects.id' value='`$network-topology-operation-input.network-request-input.network-input-parameters.l3-dci-connects.id.value`' />
- </set>
- </outcome>
- </switch>
- <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name="restapiUrl" value="$prop.sdncRestApi.thirdpartySdnc.url + '/v2.0/l3-dci-connects/' + $prop.l3-dci-connects.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="delete"/>
- <parameter name="responsePrefix" value="restapi-result"/>
- </execute>
- <return status='success'>
- <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> \ No newline at end of file