diff options
author | prakash.e <prakash.e@huawei.com> | 2018-08-24 19:21:33 +0530 |
---|---|---|
committer | prakash.e <prakash.e@huawei.com> | 2018-08-24 19:23:41 +0530 |
commit | 07d173c059f15fe9959deec9650246b173a3b50c (patch) | |
tree | f7e63ec52f90602038b73500ce1c192b8774591f /platform-logic/generic-resource-api/src/main/xml | |
parent | cc49cb7753ff820dada996ab1d56263243630395 (diff) |
SDWAN flow based end-end test and issue fix
SDWAN DGs and restapi templates issue fixes
Change-Id: I5d1d4e6cb17e9b187ea4f0942ca837472738fe62
Issue-ID: SDNC-357
Signed-off-by: Prakash.E <prakash.e@huawei.com>
Former-commit-id: b1da373ad0e08400b4c1f2a8cfbb69524df745a2
Diffstat (limited to 'platform-logic/generic-resource-api/src/main/xml')
17 files changed, 658 insertions, 467 deletions
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-attachment-topology-operation-activate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-attachment-topology-operation-activate.xml index 585c8b8a..b4ceb0f8 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-attachment-topology-operation-activate.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-attachment-topology-operation-activate.xml @@ -197,7 +197,7 @@ </block>
</for>
<set>
- <parameter name='prop.ar-service-instance-id' value='`$mdsal-providedAr.connection-attachment-allotted-resource[0].allotted-resource-data.allotted-resource-operation-information.service-information.service-instance-id`' />
+ <parameter name='prop.ar-service-instance-id' value='`$mdsal-providedAr.connection-attachment-allotted-resource[0].allotted-resource-data.connection-attachment-topology.allotted-resource-identifiers.consuming-service-instance-id`' />
</set>
<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
<parameter name="source" value="/restconf/config/GENERIC-RESOURCE-API:services/service/{service-instance-id}/service-data"/>
@@ -219,23 +219,25 @@ <block atomic="true">
<for index='arvidx' start='0' end='`$mdsal-sd.service-data.vnfs.vnf_length`' >
<block atomic="true">
- <switch test="`$mdsal-parentsd.service-data.vnfs.vnf[$arvidx].vnf-data.request-information.request-action == 'ActivateSiteInstance'`">
+ <switch test="`$mdsal-sd.service-data.vnfs.vnf[$arvidx].vnf-data.request-information.request-action == 'ActivateSiteInstance'`">
<outcome value='true'>
<block atomic="true">
<set>
<parameter name='tmp.sitevidx' value='`$arvidx`' />
</set>
- <for index="siteidx" start="0" end="`$mdsal-parentsd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length`">
+ <for index="siteidx" start="0" end="`$mdsal-sd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length`">
<block atomic="true">
- <switch test="`$mdsal-parentsd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$siteidx].name == 'siteId'`">
+ <switch test="`$mdsal-sd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$siteidx].name == 'siteId'`">
<outcome value='true'>
<block atomic="true">
<set>
- <parameter name='prop.attach.siteId' value='`$mdsal-parentsd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$siteidx].value`' />
+ <parameter name='prop.attach.siteId' value='`$mdsal-sd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$siteidx].value`' />
</set>
<set>
<parameter name='prop.siteIds[$prop.siteIds_length]' value='`$prop.attach.siteId`' />
<parameter name='prop.siteIds_length' value='`$prop.siteIds_length + 1`' />
+ </set>
+ <set>
<parameter name='prop.siteAttachements[$prop.siteAttachements_length].siteId' value='`$prop.attach.siteId`' />
<parameter name='prop.siteAttachements[$prop.siteAttachements_length].roles[0]' value='`$prop.role`' />
<parameter name='prop.siteAttachements[$prop.siteAttachements_length].roles_length' value='1' />
@@ -269,7 +271,7 @@ </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
+ key="esr-thirdparty-sdnc.thirdparty-sdnc-id = SDWANController AND
depth = '1'"
pfx='tmp.aai.esr-thirdparty-sdnc' local-only='false' >
<outcome value='success'>
@@ -296,7 +298,7 @@ </get-resource>
<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/net/vpn-services'`" />
+ <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"/>
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-attachment-topology-operation-create.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-attachment-topology-operation-create.xml index 1fa64965..29094f70 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-attachment-topology-operation-create.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-attachment-topology-operation-create.xml @@ -236,6 +236,41 @@ value="`$connection-attachment-ar-identifiers.`" /> + $connection-attachment-topology-operation-input.service-information.service-instance-id
+ '/service-data/service-topology/'`"/>
</set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $connection-attachment-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $connection-attachment-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $connection-attachment-topology-operation-input.allotted-resource-information.parent-service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="id" value="`$tmp.ar.allotted-resource-id`" />
+ <parameter name="name" value="`$prop.connection-attachment.sotnVpnName`" />
+ <parameter name="access-provider-id" value="`$prop.connection-attachment.access-provider-id`" />
+ <parameter name="access-client-id" value="`$prop.connection-attachment.access-client-id`" />
+ <parameter name="access-topology-id" value="`$prop.connection-attachment.access-topology-id`" />
+ <parameter name="access-node-id" value="`$prop.connection-attachment.access-node-id`" />
+ <parameter name="access-ltp-id" value="`$prop.connection-attachment.access-ltp-id`" />
+ <parameter name="cvlan" value="`$prop.connection-attachment.cVLAN`" />
+ <parameter name="vpn-name" value="`$prop.connection-attachment.sotnVpnName`" />
+ <parameter name="selflink" value="`$tmp.ar.self-link`" />
+ <parameter name="model-invariant-id" value="`$connection-attachment-topology-operation-input.allotted-resource-information.onap-model-information.model-invariant-uuid`" />
+ <parameter name="model-version-id" value="`$connection-attachment-topology-operation-input.allotted-resource-information.onap-model-information.model-uuid`" />
+ <parameter name="operational-status" value="Created" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </return>
+ </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="AAI failed" />
+ </return>
+ </outcome>
+ </update>
<return status='success'>
<parameter name="ack-final-indicator" value="Y" />
<parameter name="error-code" value="200" />
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-attachment-topology-operation-deactivate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-attachment-topology-operation-deactivate.xml index 5f65774f..2f87fbd5 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-attachment-topology-operation-deactivate.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-attachment-topology-operation-deactivate.xml @@ -190,7 +190,7 @@ </set>
</outcome>
</switch>
- <switch test="`$mdsal-psd.service-data.networks.network[$pnidx].network-data.network-request-input.network-input-parameters.param[$paramidx].name == 'vpnId'`">
+ <switch test="`$mdsal-psd.service-data.networks.network[$pnidx].network-data.network-request-input.network-input-parameters.param[$paramidx].name == 'vpn-id'`">
<outcome value='true'>
<set>
<parameter name='prop.vpn1Id' value='`$mdsal-parentsd.service-data.networks.network[$pnidx].network-data.network-request-input.network-input-parameters.param[$paramidx].value`' />
@@ -200,7 +200,7 @@ </block>
</for>
<set>
- <parameter name='prop.ar-service-instance-id' value='`$mdsal-providedAr.connection-attachment-allotted-resource[0].allotted-resource-data.allotted-resource-operation-information.service-information.service-instance-id`' />
+ <parameter name='prop.ar-service-instance-id' value='`$mdsal-providedAr.connection-attachment-allotted-resource[0].allotted-resource-data.connection-attachment-topology.allotted-resource-identifiers.consuming-service-instance-id`' />
</set>
<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
<parameter name="source" value="/restconf/config/GENERIC-RESOURCE-API:services/service/{service-instance-id}/service-data"/>
@@ -222,23 +222,25 @@ <block atomic="true">
<for index='arvidx' start='0' end='`$mdsal-sd.service-data.vnfs.vnf_length`' >
<block atomic="true">
- <switch test="`$mdsal-parentsd.service-data.vnfs.vnf[$arvidx].vnf-data.request-information.request-action == ActivateSiteInstance`">
+ <switch test="`$mdsal-sd.service-data.vnfs.vnf[$arvidx].vnf-data.request-information.request-action == ActivateSiteInstance`">
<outcome value='true'>
<block atomic="true">
<set>
<parameter name='tmp.sitevidx' value='`$arvidx`' />
</set>
- <for index="siteidx" start="0" end="`$mdsal-parentsd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length`">
+ <for index="siteidx" start="0" end="`$mdsal-sd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length`">
<block atomic="true">
- <switch test="`$mdsal-parentsd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$siteidx].name == 'siteId'`">
+ <switch test="`$mdsal-sd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$siteidx].name == 'siteId'`">
<outcome value='true'>
<block atomic="true">
<set>
- <parameter name='prop.attach.siteId' value='`$mdsal-parentsd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$siteidx].value`' />
+ <parameter name='prop.attach.siteId' value='`$mdsal-sd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$siteidx].value`' />
</set>
<set>
<parameter name='prop.siteIds[$prop.siteIds_length]' value='`$prop.attach.siteId`' />
<parameter name='prop.siteIds_length' value='`$prop.siteIds_length + 1`' />
+ </set>
+ <set>
<parameter name='prop.siteAttachements[$prop.siteAttachements_length].siteId' value='`$prop.attach.siteId`' />
<parameter name='prop.siteAttachements[$prop.siteAttachements_length].roles[0]' value='`$prop.role`' />
<parameter name='prop.siteAttachements[$prop.siteAttachements_length].roles_length' value='1' />
@@ -275,7 +277,7 @@ </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
+ key="esr-thirdparty-sdnc.thirdparty-sdnc-id = SDWANController AND
depth = '1'"
pfx='tmp.aai.esr-thirdparty-sdnc' local-only='false' >
<outcome value='success'>
@@ -302,7 +304,7 @@ </get-resource>
<call module='GENERIC-RESOURCE-API' rpc='sdwan-wanport-vnf-topology-operation-underlay' mode='sync' ></call>
<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/sdwan-vpn-tolopogy.json'`" />
+ <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.vpn1Id + '/topology'`" />
<parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
<parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
@@ -403,6 +405,32 @@ + $connection-attachment-topology-operation-input.service-information.service-instance-id
+ '/service-data/service-topology/'`"/>
</set>
+ <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="allotted-resource"
+ key="customer.global-customer-id = $connection-attachment-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $connection-attachment-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $connection-attachment-topology-operation-input.allotted-resource-information.parent-service-instance-id AND
+ allotted-resource.id = $tmp.ar.allotted-resource-id"
+ pfx='pfx' local-only='false' force='false'>
+ <parameter name="selflink" value="`$tmp.ar.self-link`" />
+ <parameter name="model-invariant-id" value="`$connection-attachment-topology-operation-input.allotted-resource-information.onap-model-information.model-invariant-uuid`" />
+ <parameter name="model-version-id" value="`$connection-attachment-topology-operation-input.allotted-resource-information.onap-model-information.model-uuid`" />
+ <parameter name="operational-status" value="PendingDelete" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="AAI failed" />
+ </return>
+ </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="AAI failed" />
+ </return>
+ </outcome>
+ </update>
<return status='success'>
<parameter name="ack-final-indicator" value="Y" />
<parameter name="error-code" value="200" />
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-attachment-topology-operation-delete.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-attachment-topology-operation-delete.xml index 29e1a5e6..753f41b6 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-attachment-topology-operation-delete.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-attachment-topology-operation-delete.xml @@ -155,26 +155,6 @@ + $connection-attachment-topology-operation-input.service-information.service-instance-id
+ '/service-data/service-topology/'`"/>
</set>
- <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource='allotted-resource'
- key="customer.global-customer-id = $connection-attachment-topology-operation-input.service-information.global-customer-id AND
- service-subscription.service-type = $connection-attachment-topology-operation-input.service-information.subscription-service-type AND
- service-instance.service-instance-id = $connection-attachment-topology-operation-input.allotted-resource-information.parent-service-instance-id AND
- allotted-resource.id = $tmp.ar.allotted-resource-id">
- <outcome value='failure'>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="AAI failed" />
- </return>
- </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="AAI failed" />
- </return>
- </outcome>
- </delete>
<return status='success'>
<parameter name="ack-final-indicator" value="Y" />
<parameter name="error-code" value="200" />
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-get-site-param.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-get-site-param.xml index 5be564d1..d957ba6b 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-get-site-param.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-get-site-param.xml @@ -8,14 +8,14 @@ <switch test="`$vnf-request-input.vnf-input-parameters.param[$idx].name == 'name'`">
<outcome value='true'>
<set>
- <parameter name='prop.device.name' value='`$vnf-request-input.vnf-input-parameters.param[$idx].value`' />
+ <parameter name='prop.site.name' value='`$vnf-request-input.vnf-input-parameters.param[$idx].value`' />
</set>
</outcome>
</switch>
<switch test="`$vnf-request-input.vnf-input-parameters.param[$idx].name == 'description'`">
<outcome value='true'>
<set>
- <parameter name='prop.device.description' value='`$vnf-request-input.vnf-input-parameters.param[$idx].value`' />
+ <parameter name='prop.site.description' value='`$vnf-request-input.vnf-input-parameters.param[$idx].value`' />
</set>
</outcome>
</switch>
@@ -57,7 +57,7 @@ <switch test="`$vnf-request-input.vnf-input-parameters.param[$idx].name == 'longitude'`">
<outcome value='true'>
<set>
- <parameter name='prop.site.location-latitude' value='`$vnf-request-input.vnf-input-parameters.param[$idx].value`' />
+ <parameter name='prop.site.location-longitude' value='`$vnf-request-input.vnf-input-parameters.param[$idx].value`' />
</set>
</outcome>
</switch>
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-vnf-topology-operation-device-activate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-vnf-topology-operation-device-activate.xml index 5c4d4785..5402ccdb 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-vnf-topology-operation-device-activate.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-vnf-topology-operation-device-activate.xml @@ -1,6 +1,6 @@ <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='1.2.1-SNAPSHOT'>
+ 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-vnf-topology-operation-device-activate' mode='sync'>
<block atomic="true">
<for index='vidx' start='0' end='`$service-data.vnfs.vnf_length`' >
@@ -43,7 +43,7 @@ </execute>
<get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="esr-thirdparty-sdnc"
- key="esr-thirdparty-sdnc.thirdparty-sdnc-id = SDWAN-Controller AND
+ key="esr-thirdparty-sdnc.thirdparty-sdnc-id = SDWANController AND
depth = '1'"
pfx='tmp.aai.esr-thirdparty-sdnc' local-only='false' >
<outcome value='success'>
@@ -100,7 +100,6 @@ <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 plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' ><parameter name="templateFileName" value="`$prop.restapi.templateDir + '/sdwan-wan-port.json'`" /><parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/controller/campus/v1/sdwan/net/transport-network-ports'`" /><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="wanPortResp"/><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`" /-->
<outcome value='success'>
<block atomic="true"></block>
</outcome>
@@ -114,8 +113,7 @@ </execute>
<set>
<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length].name' value="deviceId" />
- <!--parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length].value' value='`$deviceResp[0].id`' /-->
- <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length].value' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length].value' value='`$deviceResp.success[0].id`' />
<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length' value='`$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length + 1`' />
</set>
<set>
@@ -128,7 +126,7 @@ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
</set>
<set>
- <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <!--parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' /-->
<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.sdnc-request-header.' value='`$vnf-topology-operation-input.sdnc-request-header.`' />
<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.request-information.' value='`$vnf-topology-operation-input.request-information.`' />
<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.service-information.' value='`$vnf-topology-operation-input.service-information.`' />
@@ -137,7 +135,7 @@ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='device'
key='device.id = $vnf-topology-operation-input.vnf-information.vnf-id' >
<parameter name='id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
- <parameter name='device-id' value='$deviceResp[0].id' />
+ <parameter name='device-id' value='`$deviceResp.success[0].id`' />
<parameter name='operational-status' value='Active' />
</save>
<save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='service-instance:relationship-list'
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-vnf-topology-operation-device-create.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-vnf-topology-operation-device-create.xml index 821fc1f6..648ca3a4 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-vnf-topology-operation-device-create.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-vnf-topology-operation-device-create.xml @@ -1,162 +1,169 @@ -<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='1.2.1-SNAPSHOT'> - <method rpc='sdwan-vnf-topology-operation-device-create' mode='sync'> - <block atomic="true"> - <set> - <parameter name='prop.sdncCreate' value='false' /> - </set> - <switch test="`$vnf-topology-operation-input.vnf-information.vnf-id`"> - <outcome value=''> - <block atomic="true"> - <set> - <parameter name='prop.sdncCreate' value='true' /> - </set> - <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='generateUUID' > - <parameter name="ctx-destination" value="prop.vnf-id"/> - </execute> - <block atomic="true"> - <switch test='`$service-data.vnfs.vnf_length`'> - <outcome value=''> - <set> - <parameter name='vnf-index' value='0' /> - </set> - </outcome> - <outcome value='Other'> - <set> - <parameter name='vnf-index' value='`$service-data.vnfs.vnf_length`' /> - </set> - </outcome> - </switch> - <set> - <parameter name='service-data.vnfs.vnf_length' value='`$vnf-index + 1`' /> - </set> - </block> - </block> - </outcome> - <outcome value='Other'> - <block atomic="true"> - <block atomic="true"> - <switch test='`$service-data.vnfs.vnf_length`'> - <outcome value=''> - <set> - <parameter name='vnf-index' value='0' /> - </set> - </outcome> - <outcome value='Other'> - <set> - <parameter name='vnf-index' value='`$service-data.vnfs.vnf_length`' /> - </set> - </outcome> - </switch> - <set> - <parameter name='service-data.vnfs.vnf_length' value='`$vnf-index + 1`' /> - </set> - </block> - <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' > - <switch test='`$vnf-topology-operation-input.vnf-information.vnf-id == $service-data.vnfs.vnf[$idx].vnf-id`'> - <outcome value='true'> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="`'VNF id ' + $service-data.vnfs.vnf[$idx].vnf-id - + ' already exists, and has order status ' + $service-data.vnfs.vnf[$idx].vnf-data.vnf-level-oper-status.order-status`" /> - </return> - </outcome> - </switch> - </for> - <set> - <parameter name='prop.vnf-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' /> - </set> - </block> - </outcome> - </switch> - <for index="idx" start="0" end="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`"> - <block> - <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' > - <parameter name="original_string" value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name`'/> - <parameter name="regex" value="_"/> - <parameter name="ctx_memory_result_key" value="param-prefix"/> - </execute> - <set> - <parameter name="`vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name`" value='`$param-prefix[$param-prefix_length -1]`'/> - </set> - </block> - </for> - <set> - <parameter name='vnf-request-input.' value='`$vnf-topology-operation-input.vnf-request-input.`' /> - </set> - <call module='GENERIC-RESOURCE-API' rpc='sdwan-get-device-param' mode='sync' ></call> - <set> - <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-id' value='`$prop.vnf-id`' /> - </set> - <set> - <parameter name='vnfId' value='`$prop.vnf-id`' /> - <parameter name="vnf-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $vnf-topology-operation-input.service-information.service-instance-id + '/service-data/vnfs/vnf/' + $prop.vnf-id + '/vnf-data/'` " /> - </set> - <set> - <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='Created' /> - <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' /> - <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' /> - </set> - <set> - <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-id' value='`$prop.vnf-id`' /> - <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.' value='`$vnf-topology-operation-input.sdnc-request-header.`' /> - <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.' value='`$vnf-topology-operation-input.request-information.`' /> - <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.' value='`$vnf-topology-operation-input.service-information.`' /> - <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.' value='`$vnf-topology-operation-input.vnf-information.`' /> - <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.' value='`$vnf-topology-operation-input.vnf-request-input.`' /> - </set> - <switch test='`$prop.sdncCreate`'> - <outcome value='true'> - <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='device' - key='device.id = $prop.vnf-id' > - <parameter name='id' value='`$prop.vnf-id`' /> - <parameter name='esn' value='`$prop.device.name`' /> - <parameter name='name' value="true" /> - <parameter name='description' value='`$prop.device.description`' /> - <parameter name='vendor' value='`$prop.device.vendor`' /> - <parameter name='class' value='`$prop.device.class`' /> - <parameter name='type' value='`$prop.device.deviceModel`' /> - <parameter name='version' value='`$prop.device.version`' /> - <parameter name='system-ip' value='`$prop.device.systemIp`' /> - <parameter name='operational-status' value='Created' /> - <parameter name='model-customization-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`' /> - <parameter name='model-invariant-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`' /> - <parameter name='model-version-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`' /> - <parameter name='selflink' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $vnf-topology-operation-input.service-information.service-instance-id + '/service-data/vnfs/vnf/' + $prop.vnf-id + '/vnf-data/'` " /> - </save> - </outcome> - <outcome value='false'> - <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='device' - key='device.id = $prop.vnf-id' > - <parameter name='id' value='`$prop.vnf-id`' /> - <parameter name='esn' value='`$prop.device.name`' /> - <parameter name='name' value="true" /> - <parameter name='description' value='`$prop.device.description`' /> - <parameter name='vendor' value='`$prop.device.vendor`' /> - <parameter name='class' value='`$prop.device.class`' /> - <parameter name='type' value='`$prop.device.deviceModel`' /> - <parameter name='version' value='`$prop.device.version`' /> - <parameter name='system-ip' value='`$prop.device.systemIp`' /> - <parameter name='operational-status' value='Created' /> - <parameter name='model-customization-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`' /> - <parameter name='model-invariant-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`' /> - <parameter name='model-version-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`' /> - <parameter name='selflink' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $vnf-topology-operation-input.service-information.service-instance-id + '/service-data/vnfs/vnf/' + $prop.vnf-id + '/vnf-data/'` " /> - </update> - </outcome> - </switch> - <set> - <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.vnf-input-parameters.param[$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.vnf-input-parameters.param_length].name' value="sdncCreate" /> - <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.vnf-input-parameters.param[$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.vnf-input-parameters.param_length].value' value='`$prop.sdncCreate`' /> - <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.vnf-input-parameters.param_length' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.vnf-input-parameters.param_length + 1`' /> - </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>
\ No newline at end of file +<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-vnf-topology-operation-device-create' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='prop.sdncCreate' value='false' />
+ </set>
+ <switch test="`$vnf-topology-operation-input.vnf-information.vnf-id`">
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name='prop.sdncCreate' value='true' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='generateUUID' >
+ <parameter name="ctx-destination" value="prop.vnf-id"/>
+ </execute>
+ <block atomic="true">
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='vnf-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='vnf-index' value='`$service-data.vnfs.vnf_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf_length' value='`$vnf-index + 1`' />
+ </set>
+ </block>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <block atomic="true">
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='vnf-index' value='0' />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='vnf-index' value='`$service-data.vnfs.vnf_length`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf_length' value='`$vnf-index + 1`' />
+ </set>
+ </block>
+ <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test='`$vnf-topology-operation-input.vnf-information.vnf-id == $service-data.vnfs.vnf[$idx].vnf-id`'>
+ <outcome value='true'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'VNF id ' + $service-data.vnfs.vnf[$idx].vnf-id
+ + ' already exists, and has order status ' + $service-data.vnfs.vnf[$idx].vnf-data.vnf-level-oper-status.order-status`" />
+ </return>
+ </outcome>
+ </switch>
+ </for>
+ <set>
+ <parameter name='prop.vnf-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ <for index="idx" start="0" end="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`">
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name`'/>
+ <parameter name="regex" value="_"/>
+ <parameter name="ctx_memory_result_key" value="param-prefix"/>
+ </execute>
+ <set>
+ <parameter name="`vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name`" value='`$param-prefix[$param-prefix_length -1]`'/>
+ </set>
+ </block>
+ </for>
+ <set>
+ <parameter name='vnf-request-input.' value='`$vnf-topology-operation-input.vnf-request-input.`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-get-device-param' mode='sync' ></call>
+ <set>
+ <parameter name='vnfId' value='`$prop.vnf-id`' />
+ <parameter name="vnf-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $vnf-topology-operation-input.service-information.service-instance-id + '/service-data/vnfs/vnf/' + $prop.vnf-id + '/vnf-data/'` " />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='Created' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-id' value='`$prop.vnf-id`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.' value='`$vnf-topology-operation-input.sdnc-request-header.`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.' value='`$vnf-topology-operation-input.request-information.`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.' value='`$vnf-topology-operation-input.service-information.`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.' value='`$vnf-topology-operation-input.vnf-information.`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.' value='`$vnf-topology-operation-input.vnf-request-input.`' />
+ </set>
+ <switch test='`$prop.sdncCreate`'>
+ <outcome value='true'>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='device'
+ key='device.id = $prop.vnf-id' >
+ <parameter name='id' value='`$prop.vnf-id`' />
+ <parameter name='esn' value='`$prop.device.name`' />
+ <parameter name='name' value="true" />
+ <parameter name='description' value='`$prop.device.description`' />
+ <parameter name='vendor' value='`$prop.device.vendor`' />
+ <parameter name='class' value='`$prop.device.class`' />
+ <parameter name='type' value='`$prop.device.deviceModel`' />
+ <parameter name='version' value='`$prop.device.version`' />
+ <parameter name='system-ip' value='`$prop.device.systemIp`' />
+ <parameter name='operational-status' value='Created' />
+ <parameter name='model-customization-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`' />
+ <parameter name='model-invariant-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`' />
+ <parameter name='model-version-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`' />
+ <parameter name='selflink' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $vnf-topology-operation-input.service-information.service-instance-id + '/service-data/vnfs/vnf/' + $prop.vnf-id + '/vnf-data/'` " />
+ </save>
+ </outcome>
+ <outcome value='false'>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='device'
+ key='device.id = $prop.vnf-id' >
+ <parameter name='id' value='`$prop.vnf-id`' />
+ <parameter name='esn' value='`$prop.device.name`' />
+ <parameter name='name' value="true" />
+ <parameter name='description' value='`$prop.device.description`' />
+ <parameter name='vendor' value='`$prop.device.vendor`' />
+ <parameter name='class' value='`$prop.device.class`' />
+ <parameter name='type' value='`$prop.device.deviceModel`' />
+ <parameter name='version' value='`$prop.device.version`' />
+ <parameter name='system-ip' value='`$prop.device.systemIp`' />
+ <parameter name='operational-status' value='Created' />
+ <parameter name='model-customization-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`' />
+ <parameter name='model-invariant-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`' />
+ <parameter name='model-version-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`' />
+ <parameter name='selflink' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $vnf-topology-operation-input.service-information.service-instance-id + '/service-data/vnfs/vnf/' + $prop.vnf-id + '/vnf-data/'` " />
+ </update>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.vnf-input-parameters.param[$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.vnf-input-parameters.param_length].name' value="sdncCreate" />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.vnf-input-parameters.param[$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.vnf-input-parameters.param_length].value' value='`$prop.sdncCreate`' />
+ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.vnf-input-parameters.param_length' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.vnf-input-parameters.param_length + 1`' />
+ </set>
+ <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='service-instance:relationship-list'
+ key='service-instance.service-instance-id = $service-data.service-information.service-instance-id
+ AND customer.global-customer-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.global-customer-id
+ AND service-subscription.service-type = $service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.subscription-service-type'
+ force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="device" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`'/network/devices/device/' + $prop.vnf-id`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="device.id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$prop.vnf-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-vnf-topology-operation-device-deactivate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-vnf-topology-operation-device-deactivate.xml index d9cea851..830cc46a 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-vnf-topology-operation-device-deactivate.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-vnf-topology-operation-device-deactivate.xml @@ -36,7 +36,7 @@ </execute>
<get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="esr-thirdparty-sdnc"
- key="esr-thirdparty-sdnc.thirdparty-sdnc-id = SDWAN-Controller AND
+ key="esr-thirdparty-sdnc.thirdparty-sdnc-id = SDWANController AND
depth = '1'"
pfx='tmp.aai.esr-thirdparty-sdnc' local-only='false' >
<outcome value='success'>
@@ -111,7 +111,7 @@ </outcome>
</execute>
<set>
- <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <!--parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' /-->
<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.sdnc-request-header.' value='`$vnf-topology-operation-input.sdnc-request-header.`' />
<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.request-information.' value='`$vnf-topology-operation-input.request-information.`' />
<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.service-information.' value='`$vnf-topology-operation-input.service-information.`' />
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-vnf-topology-operation-device-delete.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-vnf-topology-operation-device-delete.xml index 0190be0b..23cfb025 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-vnf-topology-operation-device-delete.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-vnf-topology-operation-device-delete.xml @@ -1,103 +1,117 @@ -<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-vnf-topology-operation-device-delete' mode='sync'> - <block atomic="true"> - <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' > - <parameter name="vnf-topology-operation-input.vnf-information.vnf-id" value="$vnf-topology-operation-input.vnf-information.vnf-id"/> - </execute> - <switch test="`$vnf-topology-operation-input.vnf-information.vnf-id`"> - <outcome value=''> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="vnf-request-input.vnf-input-parameters.name is a required input" /> - </return> - </outcome> - </switch> - <switch test='`$service-data.vnfs.vnf_length`'> - <outcome value=''> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" /> - </return> - </outcome> - <outcome value='Other'> - <block atomic="true"> - <for index='vidx' start='0' end='`$service-data.vnfs.vnf_length`' > - <switch test="`$service-data.vnfs.vnf[$vidx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`"> - <outcome value='true'> - <block atomic="true"> - <set> - <parameter name='tmp.vidx' value='`$vidx`' /> - <parameter name='ctx.vnf-data.' value='`$service-data.vnfs.vnf[$vidx].`' /> - </set> - <set> - <parameter name='vnf-request-input.' value='`$ctx.vnf-data.vnf-data.vnf-request-input.`' /> - </set> - <call module='GENERIC-RESOURCE-API' rpc='sdwan-get-device-param' mode='sync' ></call> - <set> - <parameter name='tmp.vidx' value='`$vidx`' /> - <parameter name='ctx.vnf-data.' value='`$service-data.vnfs.vnf[$vidx].vnf-data.`' /> - </set> - </block> - </outcome> - </switch> - </for> - <switch test="`$tmp.vidx`"> - <outcome value=''> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" /> - </return> - </outcome> - </switch> - <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="tmp.vidx1234555"/> - <parameter name="field3" value='`$tmp.vidx`'/> - </record> - </block> - </outcome> - </switch> - <switch test='`$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.order-status`'> - <outcome value='PendingDelete'> - <block atomic="true"></block> - </outcome> - <outcome value='Other'> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="`'VNF is not in appropriate state for activate. Current state is ' + $service-data.vnfs.vnf[$tmp.nidx].vnf-data.vnf-level-oper-status.order-status`" /> - </return> - </outcome> - </switch> - <set> - <parameter name="service-data.vnfs.vnf_length" value="`$service-data.vnfs.vnf_length - 1`"/> - </set> - <set> - <parameter name="service-data.vnfs.vnf[$tmp.vidx]." value=""/> - </set> - <set> - <parameter name='vnfId' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' /> - <parameter name='vnf-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' - + $vnf-topology-operation-input.service-information.service-instance-id - + '/service-data/service-topology/'` " /> - </set> - <switch test="`$prop.device.sdncCreate`"> - <outcome value='true'> - <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource='device' - key='device.id = $vnf-topology-operation-input.vnf-information.vnf-id'></delete> - </outcome> - </switch> - <return status='success'> - <parameter name="ack-final-indicator" value="Y" /> - <parameter name="error-code" value="200" /> - <parameter name="error-message" value="`$error-message`" /> - </return> - </block> - </method> -</service-logic>
\ No newline at end of file +<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-vnf-topology-operation-device-delete' mode='sync'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' >
+ <parameter name="vnf-topology-operation-input.vnf-information.vnf-id" value="$vnf-topology-operation-input.vnf-information.vnf-id"/>
+ </execute>
+ <switch test="`$vnf-topology-operation-input.vnf-information.vnf-id`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-request-input.vnf-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='vidx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <switch test="`$service-data.vnfs.vnf[$vidx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.vidx' value='`$vidx`' />
+ <parameter name='ctx.vnf-data.' value='`$service-data.vnfs.vnf[$vidx].`' />
+ </set>
+ <set>
+ <parameter name='vnf-request-input.' value='`$ctx.vnf-data.vnf-data.vnf-request-input.`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-get-device-param' mode='sync' ></call>
+ <set>
+ <parameter name='tmp.vidx' value='`$vidx`' />
+ <parameter name='ctx.vnf-data.' value='`$service-data.vnfs.vnf[$vidx].vnf-data.`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.vidx`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <switch test='`$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.order-status`'>
+ <outcome value='PendingDelete'>
+ <block atomic="true"></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'VNF is not in appropriate state for activate. Current state is ' + $service-data.vnfs.vnf[$tmp.nidx].vnf-data.vnf-level-oper-status.order-status`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='prop.vnfidxLen' value='`0`' />
+ </set>
+ <for index='lidx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <block atomic="true">
+ <switch test="`$service-data.vnfs.vnf[$lidx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`">
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='service-data.vnfs.vnf[$prop.vnfidxLen].vnf-id' value='`$service-data.vnfs.vnf[$lidx].vnf-id`' />
+ <parameter name='service-data.vnfs.vnf[$prop.vnfidxLen].vnf-data.' value='`$service-data.vnfs.vnf[$lidx].vnf-data.`' />
+ </set>
+ <set>
+ <parameter name='prop.vnfidxLen' value='`$prop.vnfidxLen + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name="service-data.vnfs.vnf_length" value='`$prop.vnfidxLen`'/>
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$prop.vnfidxLen]." value=""/>
+ </set>
+ <set>
+ <parameter name='vnfId' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='vnf-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $vnf-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'` " />
+ </set>
+ <switch test="`$prop.device.sdncCreate`">
+ <outcome value='true'>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource='device'
+ key='device.id = $vnf-topology-operation-input.vnf-information.vnf-id'></delete>
+ </outcome>
+ </switch>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-vnf-topology-operation-wanport-activate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-vnf-topology-operation-wanport-activate.xml index 59e03134..3879fdc1 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-vnf-topology-operation-wanport-activate.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-vnf-topology-operation-wanport-activate.xml @@ -144,7 +144,7 @@ </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
+ key="esr-thirdparty-sdnc.thirdparty-sdnc-id = SDWANController AND
depth = '1'"
pfx='tmp.aai.esr-thirdparty-sdnc' local-only='false' >
<outcome value='success'>
@@ -198,7 +198,7 @@ <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="httpMethod" value="put"/>
<parameter name="responsePrefix" value="portResp"/>
<parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.openecomp.client.jks"/>
<parameter name="trustStorePassword" value="adminadmin"/>
@@ -216,19 +216,10 @@ <block atomic="true"></block>
</outcome>
</execute>
- <for index="portidx" start="0" end="`$portResp_length`">
- <block>
- <switch test="`$portResp[$portidx].deviceId == $prop.deviceId`">
- <outcome value='true'>
- <set>
- <parameter name='prop.wan.devicePortId' value='`$portResp[$portidx].id`' />
- </set>
- </outcome>
- </switch>
- </block>
- </for>
+ <set>
+ <parameter name='prop.wan.devicePortId' value='`$portResp.success[0].id`' />
+ </set>
<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`" />
@@ -251,19 +242,19 @@ <block atomic="true"></block>
</outcome>
</execute>
- <for index="tidx" start="0" end="`$transportNetworksResp.transportNetworks_length`">
+ <for index="tidx" start="0" end="`$transportNetworksResp.data.transportNetworks_length`">
<block>
- <switch test="`$transportNetworksResp.transportNetworks[$tidx].name == $prop.wan.transportNetworkName`">
+ <switch test="`$transportNetworksResp.data.transportNetworks[$tidx].name == $prop.wan.transportNetworkName`">
<outcome value='true'>
<set>
- <parameter name='prop.wan.transportNetworkId' value='`$transportNetworksResp[$tidx].id`' />
+ <parameter name='prop.wan.transportNetworkId' value='`$transportNetworksResp.data.transportNetworks[$tidx].id`' />
</set>
</outcome>
</switch>
</block>
</for>
<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
- <parameter name="original_string" value='`$prop.ipAddress`'/>
+ <parameter name="original_string" value='`$prop.wan.ipAddress`'/>
<parameter name="regex" value="/"/>
<parameter name="ctx_memory_result_key" value="ipandMask"/>
<outcome value='success'>
@@ -303,26 +294,21 @@ <block atomic="true"></block>
</outcome>
</execute>
- <for index="wanPortidx" start="0" end="`$wanPortResp_length`">
- <block>
- <switch test="`$wanPortResp[$wanPortidx].deviceId == $prop.deviceId`">
- <outcome value='true'>
- <set>
- <parameter name='prop.wan.wanPortId' value='`$wanPortResp[$wanPortidx].id`' />
- </set>
- </outcome>
- </switch>
- </block>
- </for>
+ <set>
+ <parameter name='prop.wan.wanPortId' value='`$wanPortResp.success[0].id`' />
+ </set>
<set>
<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length].name' value='devicePortId' />
<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length].value' value='`$prop.wan.devicePortId`' />
- <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length + 1].name' value='wanPortId' />
- <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length + 1].value' value='`$prop.wan.wanPortId`' />
- <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length' value='`$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length + 2`' />
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length' value='`$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length + 1`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length].name' value='wanPortId' />
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length].value' value='`$prop.wan.wanPortId`' />
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length' value='`$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length + 1`' />
</set>
<set>
- <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-id' value='`$service-data.vnfs.vnf[$tmp.vidx].vnf-id`' />
+ <!--parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' /-->
<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' />
<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' />
<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' />
@@ -336,6 +322,16 @@ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
</set>
+ <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='wan-port-config'
+ key='wan-port-config.id = $vnf-topology-operation-input.vnf-information.vnf-id' >
+ <parameter name="id" value="`$vnf-topology-operation-input.vnf-information.vnf-id`" />
+ <parameter name='operational-status' value='Active' />
+ <parameter name='device-port-id' value='`$prop.wan.devicePortId`' />
+ <parameter name='wan-port-id' value='`$prop.wan.wanPortId`' />
+ <parameter name='model-customization-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`' />
+ <parameter name='model-invariant-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`' />
+ <parameter name='model-version-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`' />
+ </update>
<return status='success'>
<parameter name="ack-final-indicator" value="Y" />
<parameter name="error-code" value="200" />
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-vnf-topology-operation-wanport-deactivate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-vnf-topology-operation-wanport-deactivate.xml index f6222749..7a7c22e3 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-vnf-topology-operation-wanport-deactivate.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-vnf-topology-operation-wanport-deactivate.xml @@ -56,7 +56,7 @@ </execute>
<get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="esr-thirdparty-sdnc"
- key="esr-thirdparty-sdnc.thirdparty-sdnc-id = SDWAN-Controller AND
+ key="esr-thirdparty-sdnc.thirdparty-sdnc-id = SDWANController AND
depth = '1'"
pfx='tmp.aai.esr-thirdparty-sdnc' local-only='false' >
<outcome value='success'>
@@ -134,7 +134,7 @@ <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="httpMethod" value="post"/>
<parameter name="responsePrefix" value="portResp"/>
<parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.openecomp.client.jks"/>
<parameter name="trustStorePassword" value="adminadmin"/>
@@ -153,7 +153,7 @@ </outcome>
</execute>
<set>
- <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-id' value='`$service-data.vnfs.vnf[$tmp.vidx].vnf-id`' />
+ <!--parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' /-->
<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.sdnc-request-header.' value='`$vnf-topology-operation-input.sdnc-request-header.`' />
<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.request-information.' value='`$vnf-topology-operation-input.request-information.`' />
<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.service-information.' value='`$vnf-topology-operation-input.service-information.`' />
@@ -169,8 +169,8 @@ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
</set>
<update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='wan-port-config'
- key='wan-port-config.id = $service-data.vnfs.vnf[$tmp.vidx].vnf-id' >
- <parameter name="id" value="`$service-data.vnfs.vnf[$tmp.vidx].vnf-id`" />
+ key='wan-port-config.id = $vnf-topology-operation-input.vnf-information.vnf-id' >
+ <parameter name="id" value="`$vnf-topology-operation-input.vnf-information.vnf-id`" />
<parameter name='operational-status' value='PendingDelete' />
<parameter name='model-customization-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`' />
<parameter name='model-invariant-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`' />
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-vnf-topology-operation-wanport-delete.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-vnf-topology-operation-wanport-delete.xml index e0f53a91..e6810860 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-vnf-topology-operation-wanport-delete.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-vnf-topology-operation-wanport-delete.xml @@ -44,12 +44,6 @@ </return>
</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="tmp.vidx1234555"/>
- <parameter name="field3" value='`$tmp.vidx`'/>
- </record>
</block>
</outcome>
</switch>
@@ -66,10 +60,30 @@ </outcome>
</switch>
<set>
- <parameter name="service-data.vnfs.vnf_length" value="`$service-data.vnfs.vnf_length - 1`"/>
+ <parameter name='prop.vnfidxLen' value='`0`' />
</set>
+ <for index='lidx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <block atomic="true">
+ <switch test="`$service-data.vnfs.vnf[$lidx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`">
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='service-data.vnfs.vnf[$prop.vnfidxLen].vnf-id' value='`$service-data.vnfs.vnf[$lidx].vnf-id`' />
+ <parameter name='service-data.vnfs.vnf[$prop.vnfidxLen].vnf-data.' value='`$service-data.vnfs.vnf[$lidx].vnf-data.`' />
+ </set>
+ <set>
+ <parameter name='prop.vnfidxLen' value='`$prop.vnfidxLen + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
<set>
- <parameter name="service-data.vnfs.vnf[$tmp.vidx]." value=""/>
+ <parameter name="service-data.vnfs.vnf_length" value='`$prop.vnfidxLen`'/>
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$prop.vnfidxLen]." value=""/>
</set>
<set>
<parameter name='vnfId' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-wanport-vnf-topology-operation-underlay.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-wanport-vnf-topology-operation-underlay.xml index 9db916e0..ebe9422c 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-wanport-vnf-topology-operation-underlay.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-wanport-vnf-topology-operation-underlay.xml @@ -4,6 +4,9 @@ <method rpc='sdwan-wanport-vnf-topology-operation-underlay' mode='sync'>
<block atomic="true">
<set>
+ <parameter name='prop.underlay.routeIds_length' value='0' />
+ </set>
+ <set>
<parameter name='prop.provision.siteIds_length' value='0' />
</set>
<for index='cidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' >
@@ -34,10 +37,10 @@ </set>
<for index="roleidx" start="0" end="`$mdsal-ar.connection-attachment-allotted-resource[0].allotted-resource-data.allotted-resource-operation-information.connection-attachment-request-input.param_length`">
<block>
- <switch test="`$mdsal-providedAr.connection-attachment-allotted-resource[0].allotted-resource-data.allotted-resource-operation-information.connection-attachment-request-input.param[$roleidx].name == 'role'`">
+ <switch test="`$mdsal-ar.connection-attachment-allotted-resource[0].allotted-resource-data.allotted-resource-operation-information.connection-attachment-request-input.param[$roleidx].name == 'role'`">
<outcome value='true'>
<set>
- <parameter name='prop.spoke.role' value='`$mdsal-providedAr.connection-attachment-allotted-resource[0].allotted-resource-data.allotted-resource-operation-information.connection-attachment-request-input.param[$roleidx].value`' />
+ <parameter name='prop.spoke.role' value='`$mdsal-ar.connection-attachment-allotted-resource[0].allotted-resource-data.allotted-resource-operation-information.connection-attachment-request-input.param[$roleidx].value`' />
</set>
</outcome>
</switch>
@@ -128,6 +131,9 @@ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.request-information.request-action == 'ActivateSiteInstance'`">
<outcome value='true'>
<block atomic="true">
+ <set>
+ <parameter name='prop.spoke.siteidx' value='`$i`' />
+ </set>
<for index="sidx" start="0" end="`$service-data.vnfs.vnf[$i].vnf-data.vnf-request-input.vnf-input-parameters.param_length`">
<block atomic="true">
<switch test="`$service-data.vnfs.vnf[$i].vnf-data.vnf-request-input.vnf-input-parameters.param[$sidx].name == 'name'`">
@@ -144,6 +150,56 @@ </set>
</outcome>
</switch>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vnf-request-input.vnf-input-parameters.param[$sidx].name == 'underlayRouteIds'`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='prop.underlay.routeIdsString' value='`$service-data.vnfs.vnf[$i].vnf-data.vnf-request-input.vnf-input-parameters.param[$sidx].value`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value='`$prop.underlay.routeIdsString`'/>
+ <parameter name="regex" value=" | "/>
+ <parameter name="ctx_memory_result_key" value="prop.underlay.routeIdsValue"/>
+ <outcome value='success'>
+ <for index="ridx" start="0" end="`$prop.underlay.routeIdsValue_length`">
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value='`$prop.underlay.routeIdsValue[$ridx]`'/>
+ <parameter name="regex" value=","/>
+ <parameter name="ctx_memory_result_key" value="prop.underlay.routeIdsValues"/>
+ <outcome value='success'>
+ <switch test='`$prop.underlay.routeIdsValues_length`'>
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ <outcome value='3'>
+ <block atomic="true">
+ <set>
+ <parameter name='prop.underlay.routeIds[$prop.underlay.routeIds_length].hubSiteId' value='`$prop.underlay.routeIdsValues[0]`' />
+ <parameter name='prop.underlay.routeIds[$prop.underlay.routeIds_length].hubRouteId' value='`$prop.underlay.routeIdsValues[1]`' />
+ <parameter name='prop.underlay.routeIds[$prop.underlay.routeIds_length].spokeRouteId' value='`$prop.underlay.routeIdsValues[2]`' />
+ </set>
+ <set>
+ <parameter name='prop.underlay.routeIds_length' value='`$prop.underlay.routeIds_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ </execute>
+ </block>
+ </for>
+ </outcome>
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
</block>
</for>
</block>
@@ -184,17 +240,17 @@ </set>
</outcome>
</switch>
- <switch test="`$tmp.pnidx`">
- <outcome value=''>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" />
- </return>
- </outcome>
- </switch>
</block>
</for>
+ <switch test="`$tmp.pnidx`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" />
+ </return>
+ </outcome>
+ </switch>
<for index="paramidx" start="0" end="`$mdsal-psd.service-data.networks.network[$tmp.pnidx].network-data.network-request-input.network-input-parameters.param_length`">
<block atomic="true">
<switch test="`$mdsal-psd.service-data.networks.network[$tmp.pnidx].network-data.network-request-input.network-input-parameters.param[$paramidx].name == 'topology'`">
@@ -414,20 +470,6 @@ </set>
</outcome>
</switch>
- <switch test="`$mdsal-arsd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$siteidx].name == 'hubRouteId'`">
- <outcome value='true'>
- <set>
- <parameter name='prop.hubRouteId' value='`$mdsal-arsd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$siteidx].value`' />
- </set>
- </outcome>
- </switch>
- <switch test="`$mdsal-arsd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$siteidx].name == 'spokeRouteId'`">
- <outcome value='true'>
- <set>
- <parameter name='prop.spokeRouteId' value='`$mdsal-arsd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$siteidx].value`' />
- </set>
- </outcome>
- </switch>
</block>
</for>
<switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'>
@@ -438,7 +480,7 @@ <parameter name='prop.route.siteId' value='`$prop.hub.siteId`' />
<parameter name='prop.route.deviceId' value='`$prop.hub.deviceId`' />
<parameter name='prop.route.providerIpAddress' value='`$prop.hub.providerIpAddress`' />
- <parameter name='prop.route.wanportId' value='`$prop.spoke.wanportId`' />
+ <parameter name='prop.route.wanportId' value='`$prop.spoke.wanPortId`' />
<parameter name='prop.route.ipAddress' value='`$prop.hub.ipAddress`' />
</set>
<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
@@ -468,7 +510,7 @@ <parameter name='prop.route.siteId' value='`$prop.spoke.siteId`' />
<parameter name='prop.route.deviceId' value='`$prop.spoke.deviceId`' />
<parameter name='prop.route.providerIpAddress' value='`$prop.spoke.providerIpAddress`' />
- <parameter name='prop.route.wanportId' value='`$prop.hub.wanportId`' />
+ <parameter name='prop.route.wanportId' value='`$prop.hub.wanPortId`' />
<parameter name='prop.route.ipAddress' value='`$prop.spoke.ipAddress`' />
</set>
<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
@@ -494,23 +536,48 @@ <outcome value='success'></outcome>
</execute>
<set>
- <parameter name='mdsal-arsd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$mdsal-arsd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length].name' value='hubRouteId' />
- <parameter name='mdsal-arsd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$mdsal-arsd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length].value' value='`$underlayHubResp[0].id`' />
- <parameter name='mdsal-arsd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$mdsal-arsd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length + 1].name' value='spokeRouteId' />
- <parameter name='mdsal-arsd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$mdsal-arsd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length + 1].value' value='`$underlayspokeResp[0].id`' />
- <parameter name='mdsal-arsd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length' value='`$mdsal-arsd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length + 2`' />
+ <parameter name='prop.underlay.routeIds[$prop.underlay.routeIds_length].hubSiteId' value='`$prop.hub.siteId`' />
+ <!--parameter name='prop.underlay.routeIds[$prop.underlay.routeIds_length].spokeSiteId' value='`$prop.spoke.siteId`' /-->
+ <parameter name='prop.underlay.routeIds[$prop.underlay.routeIds_length].hubRouteId' value='`$underlayHubResp.success[0].id`' />
+ <parameter name='prop.underlay.routeIds[$prop.underlay.routeIds_length].spokeRouteId' value='`$underlayspokeResp.success[0].id`' />
+ </set>
+ <set>
+ <parameter name='prop.underlay.routeIds_length' value='`$prop.underlay.routeIds_length + 1`' />
+ </set>
+ <set>
+ <parameter name='prop.provision.siteIds[$prop.provision.siteIds_length].hubSiteName' value='`$prop.hub.siteName`' />
+ <parameter name='prop.provision.siteIds[$prop.provision.siteIds_length].hubSiteId' value='`$prop.hub.siteId`' />
+ <parameter name='prop.provision.siteIds[$prop.provision.siteIds_length].spokeSiteName' value='`$prop.spoke.siteName`' />
+ <parameter name='prop.provision.siteIds[$prop.provision.siteIds_length].spokeSiteId' value='`$prop.spoke.siteId`' />
+ </set>
+ <set>
+ <parameter name='prop.provision.siteIds_length' value='`$prop.provision.siteIds_length + 1`' />
</set>
</block>
</outcome>
<outcome value='DeactivateSDWANAttachmentInstance'>
<block atomic="true">
+ <for index="uidx" start="0" end="`$prop.underlay.routeIds_length`">
+ <block atomic="true">
+ <switch test="`$prop.underlay.routeIds[$uidx].hubSiteId == $prop.hub.siteId`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='prop.hubRouteId' value='`$prop.underlay.routeIds[$uidx].hubRouteId`' />
+ <parameter name='prop.spokeRouteId' value='`$prop.underlay.routeIds[$uidx].spokeRouteId`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
<set>
<parameter name='prop.route.id' value='`$prop.hubRouteId`' />
<parameter name='prop.route.vpnId' value='`$prop.vpnId`' />
<parameter name='prop.route.siteId' value='`$prop.hub.siteId`' />
<parameter name='prop.route.deviceId' value='`$prop.hub.deviceId`' />
<parameter name='prop.route.providerIpAddress' value='`$prop.hub.providerIpAddress`' />
- <parameter name='prop.route.wanportId' value='`$prop.spoke.wanportId`' />
+ <parameter name='prop.route.wanportId' value='`$prop.spoke.wanPortId`' />
<parameter name='prop.route.ipAddress' value='`$prop.hub.ipAddress`' />
</set>
<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
@@ -541,7 +608,7 @@ <parameter name='prop.route.siteId' value='`$prop.spoke.siteId`' />
<parameter name='prop.route.deviceId' value='`$prop.spoke.deviceId`' />
<parameter name='prop.route.providerIpAddress' value='`$prop.spoke.providerIpAddress`' />
- <parameter name='prop.route.wanportId' value='`$prop.hub.wanportId`' />
+ <parameter name='prop.route.wanportId' value='`$prop.hub.wanPortId`' />
<parameter name='prop.route.ipAddress' value='`$prop.spoke.ipAddress`' />
</set>
<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
@@ -569,13 +636,6 @@ </block>
</outcome>
</switch>
- <set>
- <parameter name='prop.provision.siteIds[$prop.provision.siteIds_length].hubSiteName' value='`$prop.hub.siteName`' />
- <parameter name='prop.provision.siteIds[$prop.provision.siteIds_length].hubSiteId' value='`$prop.hub.siteId`' />
- <parameter name='prop.provision.siteIds[$prop.provision.siteIds_length].spokeSiteName' value='`$prop.spoke.siteName`' />
- <parameter name='prop.provision.siteIds[$prop.provision.siteIds_length].spokeSiteId' value='`$prop.spoke.siteId`' />
- <parameter name='prop.provision.siteIds_length' value='`$prop.provision.siteIds_length + 1`' />
- </set>
</block>
</outcome>
</switch>
@@ -587,6 +647,63 @@ </block>
</outcome>
</switch>
+ <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'>
+ <outcome value='ActivateSDWANAttachmentInstance'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.routeString' value="" />
+ </set>
+ <for index="jidx" start="0" end="`$prop.underlay.routeIds_length`">
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='concat' >
+ <parameter name="source" value='`$prop.underlay.routeIds[$jidx].hubSiteId`'/>
+ <parameter name="outputPath" value="tmp.concat"/>
+ <parameter name="target" value=","/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='concat' >
+ <parameter name="source" value='`$tmp.concat`'/>
+ <parameter name="outputPath" value="tmp.concat1"/>
+ <parameter name="target" value='`$prop.underlay.routeIds[$jidx].hubRouteId`'/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='concat' >
+ <parameter name="source" value='`$tmp.concat1`'/>
+ <parameter name="outputPath" value="tmp.concat2"/>
+ <parameter name="target" value=","/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='concat' >
+ <parameter name="source" value='`$tmp.concat2`'/>
+ <parameter name="outputPath" value="tmp.concat3"/>
+ <parameter name="target" value='`$prop.underlay.routeIds[$jidx].spokeRouteId`'/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='concat' >
+ <parameter name="source" value='`$tmp.concat3`'/>
+ <parameter name="outputPath" value="tmp.concat4"/>
+ <parameter name="target" value=" | "/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='concat' >
+ <parameter name="source" value='`$tmp.routeString`'/>
+ <parameter name="outputPath" value="tmp.routeString"/>
+ <parameter name="target" value='`$tmp.concat4`'/>
+ </execute>
+ </block>
+ </for>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$prop.spoke.siteidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$service-data.vnfs.vnf[$prop.spoke.siteidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length].name' value="underlayRouteIds" />
+ <parameter name='service-data.vnfs.vnf[$prop.spoke.siteidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$service-data.vnfs.vnf[$prop.spoke.siteidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length].value' value='`$tmp.routeString`' />
+ </set>
+ <set>
+ <parameter name='service-data.vnfs.vnf[$prop.spoke.siteidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length' value='`$service-data.vnfs.vnf[$prop.spoke.siteidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='DeactivateSDWANAttachmentInstance'>
+ <block atomic="true">
+ <set>
+ <parameter name='service-data.vnfs.vnf[$prop.spoke.siteidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length' value='`$service-data.vnfs.vnf[$prop.spoke.siteidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length - 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
</block>
</outcome>
</switch>
@@ -626,7 +743,7 @@ <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
<parameter name="file" value="`'/opt/opendaylight/current/data/log/' + 'HUB-' + $prop.provision.hubSitename + '-SPOKE-' + $prop.provision.spokeSitename + '-provisionUrl'`"/>
<parameter name="field1" value="__TIMESTAMP__"/>
- <parameter name="field2" value='`$provisionUrlRsp`'/>
+ <parameter name="field2" value='`$provisionUrlRsp.success[0].url`'/>
</record>
</block>
</for>
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-activate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-activate.xml index d8233da0..90ce0e84 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-activate.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-activate.xml @@ -27,7 +27,7 @@ <parameter name='prop.site.deviceId_length' value='0' />
</set>
<for index='vidx' start='0' end='`$service-data.vnfs.vnf_length`' >
- <block>
+ <block atomic="true">
<switch test="`$service-data.vnfs.vnf[$vidx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`">
<outcome value='true'>
<block atomic="true">
@@ -39,12 +39,6 @@ <parameter name='vnf-request-input.' value='`$ctx.vnf-data.vnf-data.vnf-request-input.`' />
</set>
<call module='GENERIC-RESOURCE-API' rpc='sdwan-get-site-param' 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-site-activateeeee-delete"/>
- <parameter name="field3" value='`$prop.site.sdwan`'/>
- </record>
</block>
</outcome>
</switch>
@@ -56,7 +50,7 @@ <switch test="`$service-data.vnfs.vnf[$vidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$deviceidx].name == 'deviceId'`">
<outcome value='true'>
<set>
- <parameter name='prop.site.deviceId[$prop.site.deviceId_length]' value='`$service-data.vnfs.vnf[$tmp.deviceVidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$deviceidx].value`' />
+ <parameter name='prop.site.deviceId[$prop.site.deviceId_length]' value='`$service-data.vnfs.vnf[$vidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$deviceidx].value`' />
<parameter name='prop.site.deviceId_length' value='`$prop.site.deviceId_length + 1`' />
</set>
</outcome>
@@ -89,43 +83,23 @@ <block atomic="true">
<for index='cpidx' start='0' end='`$prop.site.controlpoints_length`' >
<block atomic="true">
- <for index='cpvidx' start='0' end='`$service-data.vnfs.vnf_length`' >
- <block>
- <switch test="`$service-data.vnfs.vnf[$vidx].vnf-data.request-information.request-action == 'ActivateSiteInstance'`">
- <outcome value='true'>
- <block atomic="true">
- <for index="sidx" start="0" end="`$service-data.vnfs.vnf[$cpvidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length`">
- <block>
- <switch test="`$service-data.vnfs.vnf[$cpvidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$sidx].name == 'name'`">
- <outcome value='true'>
- <block atomic="true">
- <switch test="`$service-data.vnfs.vnf[$cpvidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$sidx].value == $prop.site.controlpoints[$cpidx]`">
- <outcome value='true'>
- <block atomic="true">
- <for index="lidx" start="0" end="`$service-data.vnfs.vnf[$cpvidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length`">
- <block>
- <switch test="`$service-data.vnfs.vnf[$cpvidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$lidx].name == 'siteId'`">
- <outcome value='true'>
- <set>
- <parameter name='prop.site.controlpoints[$cpidx]' value='`$service-data.vnfs.vnf[$cpvidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$lidx].value`' />
- </set>
- </outcome>
- </switch>
- </block>
- </for>
- </block>
- </outcome>
- </switch>
- </block>
- </outcome>
- </switch>
- </block>
- </for>
- </block>
- </outcome>
- </switch>
- </block>
- </for>
+ <set>
+ <parameter name='prop.controlPtId' value='`$prop.site.controlpoints[$cpidx]`' />
+ </set>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="site-resource"
+ key="site-resource.name = $prop.controlPtId AND
+ depth = '1'"
+ pfx='tmp.aai.controlPoints' local-only='false' >
+ <outcome value='success'>
+ <set>
+ <parameter name='prop.site.controlpoints[$cpidx]' value='`$tmp.aai.controlPoints.generated-site-id`' />
+ </set>
+ </outcome>
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ </get-resource>
</block>
</for>
<set>
@@ -133,7 +107,7 @@ </set>
<get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="esr-thirdparty-sdnc"
- key="esr-thirdparty-sdnc.thirdparty-sdnc-id = SDWAN-Controller AND
+ key="esr-thirdparty-sdnc.thirdparty-sdnc-id = SDWANController AND
depth = '1'"
pfx='tmp.aai.esr-thirdparty-sdnc' local-only='false' >
<outcome value='success'>
@@ -193,20 +167,26 @@ <outcome value='success'>
<block atomic="true"></block>
</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 Create vpn rest api" />
+ </return>
+ </outcome>
</execute>
</block>
</outcome>
</switch>
<set>
- <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-id' value='`$service-data.vnfs.vnf[$tmp.vidx].vnf-id`' />
+ <!--parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-id' value='`$service-data.vnfs.vnf[$tmp.vidx].vnf-id`' /-->
<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length].name' value='siteId' />
- <!--parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length].value' value='`$site-result[0].id`' /-->
- <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length].value' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length].value' value='`$site-result.success[0].id`' />
<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length' value='`$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length + 1`' />
</set>
<set>
<parameter name='vnfId' value='`$service-data.vnfs.vnf[$tmp.vidx].vnf-id`' />
- <parameter name="vnf-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $vnf-topology-operation-input.service-information.service-instance-id + '/service-data/vnfs/vnf/' + $service-data.vnfs.vnf[$tmp.vidx].vnf-id + '/vnf-data/'` " />
+ <parameter name="vnf-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $vnf-topology-operation-input.service-information.service-instance-id + '/service-data/vnfs/vnf/' + $vnf-topology-operation-input.vnf-information.vnf-id + '/vnf-data/'` " />
</set>
<set>
<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.order-status' value='Active' />
@@ -214,15 +194,15 @@ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
</set>
<set>
- <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-id' value='`$service-data.vnfs.vnf[$tmp.vidx].vnf-id`' />
+ <!--parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' /-->
<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' />
<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' />
<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' />
</set>
<save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='site-resource'
- key='site-resource.id = $service-data.vnfs.vnf[$tmp.vidx].vnf-id' >
- <parameter name='id' value='`$service-data.vnfs.vnf[$tmp.vidx].vnf-id`' />
- <parameter name='generated-site-id' value='`$site-result[0].site-id`' />
+ key='site-resource.id = $vnf-topology-operation-input.vnf-information.vnf-id' >
+ <parameter name='id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
+ <parameter name='generated-site-id' value='`$site-result.success[0].id`' />
<parameter name='operational-status' value='Active' />
</save>
<return status='success'>
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-create.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-create.xml index 865aa42b..137a148b 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-create.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-create.xml @@ -60,9 +60,6 @@ <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.' value='$vnf-topology-operation-input.vnf-request-input.' />
</set>
<set>
- <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.vnf-id' value='`$prop.vnf-index`' />
- </set>
- <set>
<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='Created' />
<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-deactivate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-deactivate.xml index 67eba6fb..7eac5d05 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-deactivate.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-deactivate.xml @@ -61,6 +61,10 @@ </outcome>
</switch>
</block>
+ <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='`$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length`' >
<block>
<switch test="`$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$idx].name == 'role'`">
@@ -84,16 +88,12 @@ </switch>
</block>
</for>
- <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
- <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
- <parameter name='contextPrefix' value='prop' />
- </execute>
<switch test="`$prop.site.sdwan`">
<outcome value='true'>
<block atomic="true">
<get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="esr-thirdparty-sdnc"
- key="esr-thirdparty-sdnc.thirdparty-sdnc-id = SDWAN-Controller AND
+ key="esr-thirdparty-sdnc.thirdparty-sdnc-id = SDWANController AND
depth = '1'"
pfx='tmp.aai.esr-thirdparty-sdnc' local-only='false' >
<outcome value='success'>
@@ -133,6 +133,9 @@ <parameter name='prop.sdncRestApi.token_id' value='`$token-result.data.token_id`' />
</set>
</outcome>
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
</execute>
<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
<parameter name="templateFileName" value="`$prop.restapi.templateDir + '/sdwan-site-del.json'`" />
@@ -168,7 +171,7 @@ </set>
<set>
<parameter name='vnfId' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
- <parameter name="vnf-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $vnf-topology-operation-input.service-information.service-instance-id + '/service-data/vnfs/vnf/' + $vnf-topology-operation-input.vnf-request-input.vnf-id + '/vnf-data/'` " />
+ <parameter name="vnf-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $vnf-topology-operation-input.service-information.service-instance-id + '/service-data/vnfs/vnf/' + $vnf-topology-operation-input.vnf-information.vnf-id + '/vnf-data/'` " />
</set>
<set>
<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.order-status' value='PendingDelete' />
@@ -176,8 +179,8 @@ <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
</set>
<save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='site-resource'
- key='site-resource.id = $service-data.vnfs.vnf[$tmp.vidx].vnf-id' >
- <parameter name='id' value='`$service-data.vnfs.vnf[$tmp.vidx].vnf-id`' />
+ key='site-resource.id = $vnf-topology-operation-input.vnf-information.vnf-id' >
+ <parameter name='id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
<parameter name='operational-status' value='PendingDelete' />
</save>
<return status='success'>
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-delete.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-delete.xml index 4162ef75..f5c08816 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-delete.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-delete.xml @@ -60,10 +60,30 @@ </outcome>
</switch>
<set>
- <parameter name="service-data.vnfs.vnf_length" value="`$service-data.vnfs.vnf_length - 1`"/>
+ <parameter name='prop.vnfidxLen' value='`0`' />
</set>
+ <for index='lidx' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <block atomic="true">
+ <switch test="`$service-data.vnfs.vnf[$lidx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`">
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='service-data.vnfs.vnf[$prop.vnfidxLen].vnf-id' value='`$service-data.vnfs.vnf[$lidx].vnf-id`' />
+ <parameter name='service-data.vnfs.vnf[$prop.vnfidxLen].vnf-data.' value='`$service-data.vnfs.vnf[$lidx].vnf-data.`' />
+ </set>
+ <set>
+ <parameter name='prop.vnfidxLen' value='`$prop.vnfidxLen + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
<set>
- <parameter name="service-data.vnfs.vnf[$tmp.nidx]." value=""/>
+ <parameter name="service-data.vnfs.vnf_length" value='`$prop.vnfidxLen`'/>
+ </set>
+ <set>
+ <parameter name="service-data.vnfs.vnf[$prop.vnfidxLen]." value=""/>
</set>
<set>
<parameter name='vnfId' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />
|