diff options
author | 2017-09-28 23:53:16 +0530 | |
---|---|---|
committer | 2017-09-28 23:56:41 +0530 | |
commit | eae37304af2e7bccec4f3361be585cd2229fe651 (patch) | |
tree | 64744e35aee4a87b9923998cc06f89356b6fc87a /platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-network-input-parameters.xml | |
parent | f08e5bbafb168df633ca09e22e49659c79572837 (diff) |
Added DG for overlay input validation
Following changes are included:
1) Validated presence of mandatory input parameters
2) Validation of values for both sites.
3) Handling of l2 and l3.
Change-Id: Ic01604f445b682494157f7358f2f4eed6b720b88
Issue-Id: SDNC-107
Signed-off-by: Gaurav Agrawal <gaurav.agrawal@huawei.com>
Former-commit-id: 39f275c0e95a08a41e9c84c8662288b5af1f36ec
Diffstat (limited to 'platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-network-input-parameters.xml')
-rw-r--r-- | platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-network-input-parameters.xml | 321 |
1 files changed, 115 insertions, 206 deletions
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 620fe9ca..56325af1 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 @@ -1,213 +1,212 @@ -<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='validate-network-input-parameters' mode='sync'>
+<?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="validate-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'/>
+ <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='`$service-topology-operation-input.sdnc-request-header.svc-action`'>
- <outcome value='assign'>
+ <switch test="`$service-topology-operation-input.sdnc-request-header.svc-action`">
+ <outcome value="assign">
<block atomic="true">
- <switch test='`$network-topology-operation-input.request-information.request-action`'>
- <outcome value='CreateNetworkInstance'>
+ <switch test="`$network-topology-operation-input.request-information.request-action`">
+ <outcome value="CreateNetworkInstance">
<block atomic="true">
<for index="i" start="0" end="`$network-topology-information.network-request-input.network-input-parameters.param_length`">
<block>
<set>
- <parameter name='tmp.name' value='' />
- <parameter name='tmp.value' value='' />
+ <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'"/>
+ <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'>
+ <outcome value="name">
<switch test="`$tmp.value`">
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
+ <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>
- <outcome value='service-type'>
+ <outcome value="service-type">
<switch test="`$tmp.value`">
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
+ <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>
- <outcome value='site1-name'>
+ <outcome value="site1-name">
<switch test="`$tmp.value`">
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
+ <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>
- <outcome value='site2-name'>
+ <outcome value="site2-name">
<switch test="`$tmp.value`">
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
+ <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>
- <outcome value='sna1_name'>
+ <outcome value="sna1_name">
<switch test="`$tmp.value`">
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
+ <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>
- <outcome value='sna2_name'>
+ <outcome value="sna2_name">
<switch test="`$tmp.value`">
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
+ <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>
- <outcome value='pe1_id'>
+ <outcome value="pe1_id">
<switch test="`$tmp.value`">
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
+ <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>
- <outcome value='pe2_id'>
+ <outcome value="pe2_id">
<switch test="`$tmp.value`">
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
+ <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>
- <outcome value='ac1-id'>
+ <outcome value="ac1-id">
<switch test="`$tmp.value`">
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
+ <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>
- <outcome value='ac2-id'>
+ <outcome value="ac2-id">
<switch test="`$tmp.value`">
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
+ <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>
- <outcome value='ac1-ip'>
+ <outcome value="ac1-ip">
<switch test="`$tmp.value`">
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
+ <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>
- <outcome value='ac2-ip'>
+ <outcome value="ac2-ip">
<switch test="`$tmp.value`">
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
+ <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>
- <outcome value='ac1_peer_ip'>
+ <outcome value="ac1_peer_ip">
<switch test="`$tmp.value`">
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
+ <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>
- <outcome value='ac2_peer_ip'>
+ <outcome value="ac2_peer_ip">
<switch test="`$tmp.value`">
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
+ <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>
- <outcome value='ac1_svlan'>
+ <outcome value="ac1_svlan">
<switch test="`$tmp.value`">
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
+ <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>
- <outcome value='ac2_svlan'>
+ <outcome value="ac2_svlan">
<switch test="`$tmp.value`">
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
+ <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>
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
+ <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.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
</return>
@@ -217,9 +216,9 @@ </for>
</block>
</outcome>
- <outcome value='Other'>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
+ <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 CreateNetworkInstance for svc-action=assign" />
</return>
@@ -227,124 +226,34 @@ </switch>
</block>
</outcome>
- <outcome value='activate'>
- <switch test='`$network-topology-operation-input.request-information.request-action`'>
- <outcome value='ActivateNetworkInstance'>
+ <outcome value="activate">
+ <switch test="`$network-topology-operation-input.request-information.request-action`">
+ <outcome value="ActivateNetworkInstance">
<block atomic="true">
- <for index="i" start="0" end="`$network-topology-information.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.name is a required input" />
- </return>
- </outcome>
- </switch>
- </outcome>
- <outcome value='description'>
- <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.name is a required input" />
- </return>
- </outcome>
- </switch>
- </outcome>
- <outcome value='router_id'>
- <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.name is a required input" />
- </return>
- </outcome>
- </switch>
- </outcome>
- <outcome value='local_networks'>
- <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.name is a required input" />
- </return>
- </outcome>
- </switch>
- </outcome>
- <outcome value='evpn_irts'>
- <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.name is a required input" />
- </return>
- </outcome>
- </switch>
- </outcome>
- <outcome value='evpn_erts'>
- <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.name is a required input" />
- </return>
- </outcome>
- </switch>
- </outcome>
- <outcome value='l3_vni'>
- <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.name is a required input" />
- </return>
- </outcome>
- </switch>
- </outcome>
- </switch>
- </block>
- </for>
+ <call module="GENERIC-RESOURCE-API" rpc="validate-overlay-network-input-parameters" mode="sync" />
</block>
</outcome>
- <outcome value='Other'>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
+ <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 ActivateNetworkInstance for svc-action=activate" />
</return>
</outcome>
</switch>
</outcome>
- <outcome value='deactivate'>
+ <outcome value="deactivate">
<block atomic="true">
- <outcome value='DeactivateNetworkInstance'>
+ <outcome value="DeactivateNetworkInstance">
<block atomic="true">
- <for index='idx' start='0' end='`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`' >
+ <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'>
+ <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'/>
+ <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>
@@ -356,34 +265,34 @@ </for>
</block>
</outcome>
- <outcome value='Other'>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
+ <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 CreateNetworkInstance for svc-action=assign" />
</return>
</outcome>
</block>
</outcome>
- <outcome value='Other'>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
+ <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>
- <outcome value='delete'>
+ <outcome value="delete">
<block atomic="true">
- <outcome value='DeleteNetworkInstance'>
+ <outcome value="DeleteNetworkInstance">
<block atomic="true">
- <for index='idx' start='0' end='`$network-topology-operation-input.network-request-input.network-input-parameters.param_length`' >
+ <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'>
+ <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'/>
+ <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>
@@ -395,9 +304,9 @@ </for>
</block>
</outcome>
- <outcome value='Other'>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
+ <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 CreateNetworkInstance for svc-action=assign" />
</return>
|