diff options
author | Gaurav Agrawal <gaurav.agrawal@huawei.com> | 2017-10-05 19:55:42 +0530 |
---|---|---|
committer | Gaurav Agrawal <gaurav.agrawal@huawei.com> | 2017-10-05 14:35:45 +0000 |
commit | a26adc924eba86198fbf91e0932023fb2f79bb0d (patch) | |
tree | 774a7d766b48e272d09c76ffca4e92fc6dc08a3c /platform-logic/generic-resource-api/src/main/xml | |
parent | a673f0efbde4ded7a48722aaa85b01775fb2dd95 (diff) |
Deactivate flow modification for DCI
Changes includes:
1) Save network information SDNC's MD-SAL data store
2) Send network-id & network-object-path in network-topology-operation-output
3) Deactivation based on stored network-id
Change-Id: I4498d33e9e7921e047bfe9dff8c9801153f5f5f4
Issue-Id: SDNC-113
Signed-off-by: Gaurav Agrawal <gaurav.agrawal@huawei.com>
Former-commit-id: 4d38cecf0f03e1244ca0c605c5802632b36f3b82
Diffstat (limited to 'platform-logic/generic-resource-api/src/main/xml')
4 files changed, 276 insertions, 151 deletions
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_dci-connects-network-topology-operation-activate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_dci-connects-network-topology-operation-activate.xml index ebd32db5..d0a402c7 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_dci-connects-network-topology-operation-activate.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_dci-connects-network-topology-operation-activate.xml @@ -132,6 +132,19 @@ <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> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log" /> + <parameter name="field1" value="__TIMESTAMP__" /> + <parameter name="field2" value="dci-network-topology-operation-activate" /> + <parameter name="field3" value="dci-connects.name" /> + <parameter name="field4" value="$prop.dci-connects.name" /> + <parameter name="field5" value="dci-connects.id" /> + <parameter name="field6" value="`$prop.dci-connects.id`" /> + <parameter name="field7" value="dci-connects.tunnelType" /> + <parameter name="field8" value="`$prop.dci-connects.tunnelType`" /> + <parameter name="field9" value="sdncRestApi.thirdpartySdnc.url" /> + <parameter name="field10" value="`$prop.sdncRestApi.thirdpartySdnc.url`" /> + </record> <switch test="`$prop.dci-connects.tunnelType`"> <outcome value="L3-DCI"> <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> @@ -277,6 +290,19 @@ <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> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log" /> + <parameter name="field1" value="__TIMESTAMP__" /> + <parameter name="field2" value="dci-network-topology-operation-activate" /> + <parameter name="field3" value="dci-connects.name" /> + <parameter name="field4" value="$prop.dci-connects.name" /> + <parameter name="field5" value="dci-connects.id" /> + <parameter name="field6" value="`$prop.dci-connects.id`" /> + <parameter name="field7" value="dci-connects.tunnelType" /> + <parameter name="field8" value="`$prop.dci-connects.tunnelType`" /> + <parameter name="field9" value="sdncRestApi.thirdpartySdnc.url" /> + <parameter name="field10" value="`$prop.sdncRestApi.thirdpartySdnc.url`" /> + </record> <switch test="`$prop.dci-connects.tunnelType`"> <outcome value="L3-DCI"> <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest"> @@ -303,6 +329,39 @@ </switch> </block> </block> + <block atomic="true"> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID"> + <parameter name="ctx-destination" value="prop.dci.network-id" /> + </execute> + <switch test="`$service-data.networks.network_length`"> + <outcome value=""> + <set> + <parameter name="nidx" value="0" /> + </set> + </outcome> + <outcome value="Other"> + <set> + <parameter name="nidx" value="`$service-data.networks.network_length`" /> + </set> + </outcome> + </switch> + <set> + <parameter name="service-data.networks.network[$nidx].network-id" value="`$prop.dci.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`" /> + <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> + <set> + <parameter name="networkId" value="`$prop.dci.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.dci.network-id + '/network-data/'` " /> + </set> + </block> </block> <return status="success"> <parameter name="ack-final-indicator" value="Y" /> 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 index 3a9e57dc..3de08ffe 100644 --- 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 @@ -3,89 +3,175 @@ <method rpc="dci-connects-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"> + <block atomic="true"> + <for index="idx" start="0" end="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param_length`"> + <block> + <switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].name == 'site1_id'`"> + <outcome value="true"> + <set> + <parameter name="prop.dci-connects.id" value="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].value`" /> + </set> + </outcome> + </switch> + <switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].name == 'tunnelType'`"> + <outcome value="true"> + <set> + <parameter name="prop.dci-connects.tunnelType" value="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].value`" /> + </set> + </outcome> + </switch> + </block> + </for> + <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> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log" /> + <parameter name="field1" value="__TIMESTAMP__" /> + <parameter name="field2" value="dci-network-topology-operation-deactivate" /> + <parameter name="field3" value="dci-connects.id" /> + <parameter name="field4" value="`$prop.dci-connects.id`" /> + <parameter name="field5" value="dci-connects.tunnelType" /> + <parameter name="field6" value="`$prop.dci-connects.tunnelType`" /> + <parameter name="field7" value="dci-connects.tunnelType" /> + <parameter name="field8" value="`$prop.dci-connects.tunnelType`" /> + <parameter name="field9" value="sdncRestApi.thirdpartySdnc.url" /> + <parameter name="field10" value="`$prop.sdncRestApi.thirdpartySdnc.url`" /> + </record> + <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.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.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> + </block> + <block atomic="true"> + <for index="idx" start="0" end="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param_length`"> + <block> + <switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].name == 'site2_id'`"> + <outcome value="true"> + <set> + <parameter name="prop.dci-connects.id" value="`$service-data.networks.network[$tmp.nidx].network-data.network-request-input.network-input-parameters.param[$idx].value`" /> + </set> + </outcome> + </switch> + </block> + </for> + <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.dci-connects.tunnelType" value="`$tmp.aai.dci-connects.dci-connects.serviceType`" /> + <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> - </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.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> - <parameter name="logger" value="message-log" /> - <parameter name="field1" value="__TIMESTAMP__" /> - <parameter name="field2" value="network-topology-operation-deactivate" /> - <parameter name="field3" value="dci-connects.id" /> - <parameter name="field4" value="`$prop.dci-connects.id`" /> - <parameter name="field5" value="dci-connects.tunnelType" /> - <parameter name="field6" value="`$prop.dci-connects.tunnelType`" /> - </record> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log" /> + <parameter name="field1" value="__TIMESTAMP__" /> + <parameter name="field2" value="dci-network-topology-operation-deactivate" /> + <parameter name="field3" value="dci-connects.id" /> + <parameter name="field4" value="`$prop.dci-connects.id`" /> + <parameter name="field5" value="dci-connects.tunnelType" /> + <parameter name="field6" value="`$prop.dci-connects.tunnelType`" /> + <parameter name="field7" value="dci-connects.tunnelType" /> + <parameter name="field8" value="`$prop.dci-connects.tunnelType`" /> + <parameter name="field9" value="sdncRestApi.thirdpartySdnc.url" /> + <parameter name="field10" value="`$prop.sdncRestApi.thirdpartySdnc.url`" /> + </record> + <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.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.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> + </block> <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`" /> + <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.`" /> + </set> + <set> + <parameter name="networkId" value="`$network-topology-operation-input.network-information.network-id`" /> + </set> + <set> + <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/' + $networkId + '/network-data/network-topology/'` " /> + </set> + <set> + <parameter name="service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status" value="Deleted" /> + <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> - <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.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.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" /> 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 00848f98..13e2583a 100755 --- 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 @@ -65,59 +65,59 @@ </switch>
</outcome>
<outcome value="deactivate">
- <switch test="`$network-topology-operation-input.request-information.request-action`">
- <outcome value="DeActivateDCINetworkInstance">
- <call module="GENERIC-RESOURCE-API" rpc="dci-connects-network-topology-operation-deactivate" mode="sync" />
- </outcome>
- <outcome value="other">
- <block atomic="true">
- <switch test="`$service-data.networks.network_length`">
- <outcome value="">
- <return status="failure">
- <parameter name="ack-final" value="Y" />
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" />
- </return>
+ <block atomic="true">
+ <switch test="`$service-data.networks.network_length`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" />
+ </return>
+ </outcome>
+ <outcome value="Other">
+ <block atomic="true">
+ <for index="nidx" start="0" end="`$service-data.networks.network_length`">
+ <switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`">
+ <outcome value="true">
+ <set>
+ <parameter name="tmp.nidx" value="`$nidx`" />
+ <parameter name="ctx.network-data." value="`$service-data.networks.network[$nidx].`" />
+ </set>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.nidx`">
+ <outcome value="">
+ <return status="failure">
+ <parameter name="ack-final" value="Y" />
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`">
+ <outcome value="Created">
+ <switch test="`$network-topology-operation-input.request-information.request-action`">
+ <outcome value="DeActivateDCINetworkInstance">
+ <call module="GENERIC-RESOURCE-API" rpc="dci-connects-network-topology-operation-deactivate" mode="sync" />
</outcome>
<outcome value="Other">
- <block atomic="true">
- <for index="nidx" start="0" end="`$service-data.networks.network_length`">
- <switch test="`$service-data.networks.network[$nidx].network-id == $network-topology-operation-input.network-information.network-id`">
- <outcome value="true">
- <set>
- <parameter name="tmp.nidx" value="`$nidx`" />
- <parameter name="ctx.network-data." value="`$service-data.networks.network[$nidx].`" />
- </set>
- </outcome>
- </switch>
- </for>
- <switch test="`$tmp.nidx`">
- <outcome value="">
- <return status="failure">
- <parameter name="ack-final" value="Y" />
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="network-topology-operation-input.network-request-input.network-id not found in service-data" />
- </return>
- </outcome>
- </switch>
- </block>
- </outcome>
- </switch>
- <switch test="`$service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status`">
- <outcome value="Created">
<call module="GENERIC-RESOURCE-API" rpc="network-topology-operation-deactivate" mode="sync" />
</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>
- </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 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="unassign">
<block atomic="true">
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-network-input-parameters.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-network-input-parameters.xml index 367abdfa..6ba9d230 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-network-input-parameters.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-network-input-parameters.xml @@ -228,7 +228,7 @@ </outcome>
<outcome value="activate">
<switch test="`$network-topology-operation-input.request-information.request-action`">
- <outcome value="ActivateNetworkInstance">
+ <outcome value="ActivateDCINetworkInstance">
<block atomic="true">
<call module="GENERIC-RESOURCE-API" rpc="validate-overlay-network-input-parameters" mode="sync" />
</block>
@@ -243,28 +243,8 @@ </switch>
</outcome>
<outcome value="deactivate">
- <block atomic="true">
- <outcome value="DeactivateNetworkInstance">
- <block atomic="true">
- <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].id == 'id'`">
- <outcome value="true">
- <switch test="`$network-topology-operation-input.network-request-input.network-input-parameters.param[$idx].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.name is a required input" />
- </return>
- </outcome>
- </switch>
- </outcome>
- </switch>
- </block>
- </for>
- </block>
- </outcome>
+ <switch test="`$network-topology-operation-input.request-information.request-action`">
+ <outcome value="DeActivateDCINetworkInstance" />
<outcome value="Other">
<return status="failure">
<parameter name="ack-final" value="Y" />
@@ -272,7 +252,7 @@ <parameter name="error-message" value="request-information.request-action is required to be DeactivateNetworkInstance for svc-action=deactivate" />
</return>
</outcome>
- </block>
+ </switch>
</outcome>
<outcome value="Other">
<return status="failure">
@@ -316,4 +296,4 @@ </switch>
</block>
</method>
-</service-logic>
+</service-logic>
\ No newline at end of file |