diff options
author | shashikanth.vh <shashikanth.vh@huawei.com> | 2018-08-17 23:54:16 +0530 |
---|---|---|
committer | shashikanth.vh <shashikanth.vh@huawei.com> | 2018-08-17 23:54:24 +0530 |
commit | cd162368588c8c91832c37a09e43621063abb61b (patch) | |
tree | 52099688e58d3bca3e9bc2751cfef8f8c3edcd86 /platform-logic/generic-resource-api/src/main/xml | |
parent | cb1aa771847fe52d74eebdd7dc6ad6b1218e1a22 (diff) |
SDWAN WAN Attach site addition
Updates include:
- Addition of sdwan Attach site resource DG
- Templates
- Defect fixes
Change-Id: Ie646f6a131a4124ac9228de4938d481d799d111f
Issue-ID: SDNC-357
Signed-off-by: shashikanth.vh <shashikanth.vh@huawei.com>
Former-commit-id: 28a98a71d3b3a44e7269de435f0591946f2456d1
Diffstat (limited to 'platform-logic/generic-resource-api/src/main/xml')
9 files changed, 2431 insertions, 365 deletions
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_connection-attachment-topology-operation.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_connection-attachment-topology-operation.xml index ff587ce8..7376942a 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_connection-attachment-topology-operation.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_connection-attachment-topology-operation.xml @@ -1,82 +1,94 @@ -<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='connection-attachment-topology-operation' mode='sync'> - <block atomic="true"> - <call module='GENERIC-RESOURCE-API' rpc='validate-connection-attachment-input' mode='sync' ></call> - <switch test='`$connection-attachment-topology-operation-input.sdnc-request-header.svc-action`'> - <outcome value='create'> - <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'> - <outcome value='CreateSOTNAttachmentInstance'> - <call module='GENERIC-RESOURCE-API' rpc='sotn-attachment-topology-operation-create' mode='sync' ></call> - </outcome> - <outcome value='other'> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="`'Provided request-action=' + $connection-attachment-topology-operation-input.request-information.request-action + ' is not supported.'`" /> - </return> - </outcome> - </switch> - </outcome> - <outcome value='activate'> - <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'> - <outcome value='ActivateSOTNAttachmentInstance'> - <call module='GENERIC-RESOURCE-API' rpc='sotn-attachment-topology-operation-activate' mode='sync' ></call> - </outcome> - <outcome value='other'> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="`'Provided request-action=' + $connection-attachment-topology-operation-input.request-information.request-action + ' is not supported.'`" /> - </return> - </outcome> - </switch> - </outcome> - <outcome value='deactivate'> - <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'> - <outcome value='DeactivateSOTNAttachmentInstance'> - <call module='GENERIC-RESOURCE-API' rpc='sotn-attachment-topology-operation-deactivate' mode='sync' ></call> - </outcome> - <outcome value='other'> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="`'Provided request-action=' + $connection-attachment-topology-operation-input.request-information.request-action + ' is not supported.'`" /> - </return> - </outcome> - </switch> - </outcome> - <outcome value='delete'> - <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'> - <outcome value='DeleteSOTNAttachmentInstance'> - <call module='GENERIC-RESOURCE-API' rpc='sotn-attachment-topology-operation-delete' mode='sync' ></call> - </outcome> - <outcome value='other'> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="`'Provided request-action=' + $connection-attachment-topology-operation-input.request-information.request-action + ' is not supported.'`" /> - </return> - </outcome> - </switch> - </outcome> - <outcome value='Other'> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="sdnc-request-header.svc-action is invalid" /> - </return> - </outcome> - </switch> - <set> - <parameter name="ack-final" value="Y"/> - </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='connection-attachment-topology-operation' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-connection-attachment-input' mode='sync' ></call>
+ <switch test='`$connection-attachment-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='create'>
+ <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateSOTNAttachmentInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-attachment-topology-operation-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='CreateSDWANAttachmentInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-attachment-topology-operation-create' mode='sync' ></call>
+ </outcome>
+ <outcome value='other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Provided request-action=' + $connection-attachment-topology-operation-input.request-information.request-action + ' is not supported.'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='activate'>
+ <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'>
+ <outcome value='ActivateSOTNAttachmentInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-attachment-topology-operation-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='ActivateSDWANAttachmentInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-attachment-topology-operation-activate' mode='sync' ></call>
+ </outcome>
+ <outcome value='other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Provided request-action=' + $connection-attachment-topology-operation-input.request-information.request-action + ' is not supported.'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='deactivate'>
+ <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeactivateSOTNAttachmentInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-attachment-topology-operation-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeactivateSDWANAttachmentInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-attachment-topology-operation-deactivate' mode='sync' ></call>
+ </outcome>
+ <outcome value='other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Provided request-action=' + $connection-attachment-topology-operation-input.request-information.request-action + ' is not supported.'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='delete'>
+ <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteSOTNAttachmentInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sotn-attachment-topology-operation-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='DeleteSDWANAttachmentInstance'>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-attachment-topology-operation-delete' mode='sync' ></call>
+ </outcome>
+ <outcome value='other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Provided request-action=' + $connection-attachment-topology-operation-input.request-information.request-action + ' is not supported.'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-action is invalid" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="ack-final" value="Y"/>
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-attachment-topology-operation-activate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-attachment-topology-operation-activate.xml new file mode 100644 index 00000000..585c8b8a --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-attachment-topology-operation-activate.xml @@ -0,0 +1,434 @@ +<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-attachment-topology-operation-activate' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ar.allotted-resource-id' value='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+ <parameter name='tmp.ar.parent-service-instance-id' value='`$connection-attachment-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:connection-attachment-allotted-resources/connection-attachment-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/connection-attachment-topology/'` " />
+ </set>
+ <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>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.connection-attachment-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$mdsal-ar.connection-attachment-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name='connection-attachment-ar.' value='$mdsal-ar.connection-attachment-allotted-resource[0].' />
+ </set>
+ <switch test='`$connection-attachment-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+ <outcome value='Created'>
+ <block></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="`'Existing connection-attachment-allotted-resource with order status of ' + $connection-attachment-ar.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$connection-attachment-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$connection-attachment-ar.allotted-resource-status.rpc-action`' />
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$connection-attachment-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Connection attachment resource not exist" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Connection attachment resource not exist" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-get-saved-ar-param' mode='sync' ></call>
+ </block>
+ <set>
+ <parameter name='tmp.ar.parent-service-instance-id' value="`$connection-attachment-topology-operation-input.allotted-resource-information.parent-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"/>
+ <parameter name="outputPath" value="tmp.ar-url-psd"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url-psd`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-psd" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Parent service data not available" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='prop.siteAttachements_length' value='0' />
+ <parameter name='prop.siteIds_length' value='0' />
+ </set>
+ <for index='pidx' start='0' end='`$mdsal-psd.service-data.provided-allotted-resources.provided-allotted-resource_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='prop.ar.provided-allotted-resource-id' value='`$mdsal-psd.service-data.provided-allotted-resources.provided-allotted-resource[$pidx].allotted-resource-id`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.connection-attachment-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url-connection"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$prop.ar.provided-allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url-connection`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-providedAr" />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <for index="aridx" start="0" end="`$mdsal-providedAr.connection-attachment-allotted-resource[0].allotted-resource-data.allotted-resource-operation-information.connection-attachment-request-input.param_length`">
+ <block atomic="true">
+ <switch test="`$mdsal-providedAr.connection-attachment-allotted-resource[0].allotted-resource-data.allotted-resource-operation-information.connection-attachment-request-input.param[$aridx].name == 'role'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.role' value='`$mdsal-providedAr.connection-attachment-allotted-resource[0].allotted-resource-data.allotted-resource-operation-information.connection-attachment-request-input.param[$aridx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$mdsal-providedAr.connection-attachment-allotted-resource[0].allotted-resource-data.allotted-resource-operation-information.connection-attachment-request-input.param[$aridx].name == 'sdwanVpnName'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.name' value='`$mdsal-providedAr.connection-attachment-allotted-resource[0].allotted-resource-data.allotted-resource-operation-information.connection-attachment-request-input.param[$aridx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='prop.ar-parent-service-instance-id' value='`$mdsal-providedAr.connection-attachment-allotted-resource[0].allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.parent-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"/>
+ <parameter name="outputPath" value="tmp.ar-url-connection"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$prop.ar-parent-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url-connection`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-parentsd" />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <for index='pnidx' start='0' end='`$mdsal-parentsd.service-data.networks.network_length`' >
+ <block atomic="true">
+ <switch test="`$mdsal-parentsd.service-data.networks.network[$pnidx].network-data.request-information.request-action == ActivateSDWANConnectivityInstance`">
+ <outcome value='true'>
+ <block atomic="true">
+ <for index="paramidx" start="0" end="`$mdsal-parentsd.service-data.networks.network[$pnidx].network-data.network-request-input.network-input-parameters.param_length`">
+ <block atomic="true">
+ <switch test="`$mdsal-psd.service-data.networks.network[$pnidx].network-data.network-request-input.network-input-parameters.param[$paramidx].name == 'topology'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.topology' value='`$mdsal-psd.service-data.networks.network[$pnidx].network-data.network-request-input.network-input-parameters.param[$paramidx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ <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`' />
+ </set>
+ </outcome>
+ </switch>
+ </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`' />
+ </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"/>
+ <parameter name="outputPath" value="tmp.ar-url-connection"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$prop.ar-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url-connection`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-sd" />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ <outcome value='success'>
+ <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'`">
+ <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`">
+ <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'`">
+ <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`' />
+ </set>
+ <set>
+ <parameter name='prop.siteIds[$prop.siteIds_length]' value='`$prop.attach.siteId`' />
+ <parameter name='prop.siteIds_length' value='`$prop.siteIds_length + 1`' />
+ <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' />
+ <parameter name='prop.siteAttachements_length' value='`$prop.siteAttachements_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </for>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="esr-thirdparty-sdnc"
+ key="esr-thirdparty-sdnc.thirdparty-sdnc-id = SDWAN-Controller AND
+ depth = '1'"
+ pfx='tmp.aai.esr-thirdparty-sdnc' local-only='false' >
+ <outcome value='success'>
+ <set>
+ <parameter name='prop.sdncRestApi.thirdpartySdnc.url' value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].service-url`" />
+ <parameter name='prop.sdncRestApi.thirdpartySdnc.user' value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].user-name`" />
+ <parameter name='prop.sdncRestApi.thirdpartySdnc.password' value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].password`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'An error occurred while querying esr-thirdparty-sdnc from AnAI with thirdparty-sdnc-id = ' + $tmp.thirdparty-sdnc-id`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unexpected error occurred while querying esr-thirdparty-sdnc from AnAI with thirdparty-sdnc-id = ' + $tmp.thirdparty-sdnc-id`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/sdwan-vpn.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/controller/campus/v1/sdwan/net/vpn-services'`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json"/>
+ <parameter name="httpMethod" value="put"/>
+ <parameter name="responsePrefix" value="vpn-result"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.openecomp.client.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <parameter name='customHttpHeaders' value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`" />
+ <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 failed" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/sdwan-vpn-topology.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/controller/campus/v1/sdwan/overlay-network/' + $prop.vpn1Id + '/topology'`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json"/>
+ <parameter name="httpMethod" value="put"/>
+ <parameter name="responsePrefix" value="vpn-result"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.openecomp.client.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <parameter name='customHttpHeaders' value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`" />
+ <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 topology failed" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-wanport-vnf-topology-operation-underlay' mode='sync' ></call>
+ <set>
+ <parameter name='connection-attachment-ar.allotted-resource-status.action' value="`$connection-attachment-topology-operation-input.request-information.request-action` " />
+ <parameter name='connection-attachment-ar.allotted-resource-status.rpc-name' value="connection-attachment-topology-operation" />
+ <parameter name='connection-attachment-ar.allotted-resource-status.rpc-action' value="`$connection-attachment-topology-operation-input.sdnc-request-header.svc-action` " />
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$connection-attachment-topology-operation-input.request-information.` " />
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$connection-attachment-topology-operation-input.sdnc-request-header.` " />
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$connection-attachment-topology-operation-input.service-information.` " />
+ </set>
+ <set>
+ <parameter name='connection-attachment-ar.allotted-resource-data.connection-attachment-topology.onap-model-information.' value="`$connection-attachment-topology-operation-input.allotted-resource-information.onap-model-information.` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Active' />
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$connection-attachment-topology-operation-input.request-information.request-action`' />
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$connection-attachment-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$connection-attachment-topology-operation-input.sdnc-request-header.svc-request-id`' />
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sdwan-attachment.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block></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 updating md-sal for connection-attachment-allotted-resource" />
+ </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="Error updating md-sal for connection-attachment-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+ <parameter name='connection-attachment-object-path' value="`$tmp.ar.self-link`"/>
+ <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $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="description" value="`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-type`" />
+ <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="Active" />
+ <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" />
+ <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-attachment-topology-operation-create.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-attachment-topology-operation-create.xml new file mode 100644 index 00000000..1fa64965 --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-attachment-topology-operation-create.xml @@ -0,0 +1,246 @@ +<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-attachment-topology-operation-create' mode='sync'>
+ <block atomic="true">
+ <switch test='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='generateUUID' >
+ <parameter name="ctx-destination" value="tmp.ar.allotted-resource-id"/>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value="An error occured while generation allotted resource ID" />
+ </return>
+ </outcome>
+ </execute>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.ar.allotted-resource-id' value='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-type`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.ar.allotted-resource-type' value="SDWANAttachmentInstance" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='tmp.ar.allotted-resource-type' value='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-type`' />
+ </set>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:connection-attachment-allotted-resources/connection-attachment-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/connection-attachment-topology/'` " />
+ </set>
+ <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>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.connection-attachment-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='failure'>
+ <block></block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$mdsal-ar.connection-attachment-allotted-resource_length`'>
+ <outcome value='1'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error: Existing connection attachment allotted resource" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </execute>
+ <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'>
+ <outcome value=''>
+ <set>
+ <parameter name='tmp.cidx' value="`0`" />
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value="1" />
+ </set>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.found-cidx' value="`false`" />
+ </set>
+ <for index='cidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' >
+ <switch test="`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].allotted-resource-id == $tmp.ar.allotted-resource-id`">
+ <outcome value='true'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error updating md-sal for connection-attachment-allotted-resource as cosumed allotted resource already exists." />
+ </return>
+ </outcome>
+ </switch>
+ </for>
+ <switch test='`$tmp.found-cidx`'>
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.cidx' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-type' value="`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-type` " />
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-pointer' value="`$tmp.ar.self-link` " />
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value='`$tmp.cidx + 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.parent-service-instance-id' value="`$connection-attachment-topology-operation-input.allotted-resource-information.parent-service-instance-id` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.parent-provided-resource`"/>
+ <parameter name="outputPath" value="tmp.parent-ar-url"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$tmp.parent-ar-url`"/>
+ <parameter name="outputPath" value="tmp.parent-ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="parent" />
+ <outcome value='success'>
+ <block></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 updating md-sal for connection-attachment-allotted-resource" />
+ </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="Error updating md-sal for connection-attachment-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='connection-attachment-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ <parameter name='connection-attachment-ar.allotted-resource-status.action' value="`$connection-attachment-topology-operation-input.request-information.request-action` " />
+ <parameter name='connection-attachment-ar.allotted-resource-status.rpc-name' value="connection-attachment-topology-operation" />
+ <parameter name='connection-attachment-ar.allotted-resource-status.rpc-action' value="`$connection-attachment-topology-operation-input.sdnc-request-header.svc-action` " />
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$connection-attachment-topology-operation-input.request-information.` " />
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$connection-attachment-topology-operation-input.sdnc-request-header.` " />
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$connection-attachment-topology-operation-input.service-information.` " />
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$connection-attachment-topology-operation-input.allotted-resource-information.` " />
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-operation-information.connection-attachment-request-input.' value="`$connection-attachment-topology-operation-input.connection-attachment-request-input.` " />
+ </set>
+ <set>
+ <parameter name='connection-attachment-ar-identifiers.consuming-service-instance-id' value="`$connection-attachment-topology-operation-input.service-information.service-instance-id` " />
+ <parameter name='connection-attachment-ar-identifiers.parent-service-instance-id' value="`$connection-attachment-topology-operation-input.allotted-resource-information.parent-service-instance-id` " />
+ <parameter name='connection-attachment-ar-identifiers.allotted-resource-type' value="`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-type` " />
+ <parameter name='connection-attachment-ar-identifiers.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
+ </set>
+ <set>
+ <parameter name='connection-attachment-ar.allotted-resource-data.connection-attachment-topology.allotted-resource-identifiers.'
+value="`$connection-attachment-ar-identifiers.`" />
+ </set>
+ <set>
+ <parameter name='connection-attachment-ar.allotted-resource-data.connection-attachment-topology.onap-model-information.' value="`$connection-attachment-topology-operation-input.allotted-resource-information.onap-model-information.` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='Created' />
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$connection-attachment-topology-operation-input.request-information.request-action`' />
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$connection-attachment-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$connection-attachment-topology-operation-input.sdnc-request-header.svc-request-id`' />
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <block atomic="true">
+ <for index='i' start='0' end='`$connection-attachment-ar.allotted-resource-data.allotted-resource-operation-information.connection-attachment-request-input.param_length`' >
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="original_string" value='`$connection-attachment-ar.allotted-resource-data.allotted-resource-operation-information.connection-attachment-request-input.param[$i].name`'/>
+ <parameter name="regex" value="_"/>
+ <parameter name="ctx_memory_result_key" value="param-prefix"/>
+ </execute>
+ <set>
+ <parameter name="`connection-attachment-ar.allotted-resource-data.allotted-resource-operation-information.connection-attachment-request-input.param[$i].name`" value='`$param-prefix[$param-prefix_length -1]`'/>
+ </set>
+ </block>
+ </for>
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-get-saved-ar-param' mode='sync' ></call>
+ </block>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sdwan-attachment.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block></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 updating md-sal for connection-attachment-allotted-resource" />
+ </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="Error updating md-sal for connection-attachment-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+ <parameter name='connection-attachment-object-path' value="`$tmp.ar.self-link`"/>
+ <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $connection-attachment-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-attachment-topology-operation-deactivate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-attachment-topology-operation-deactivate.xml new file mode 100644 index 00000000..5f65774f --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-attachment-topology-operation-deactivate.xml @@ -0,0 +1,413 @@ +<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-attachment-topology-operation-deactivate' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ar.allotted-resource-id' value='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+ <parameter name='tmp.ar.parent-service-instance-id' value='`$connection-attachment-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:connection-attachment-allotted-resources/connection-attachment-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/connection-attachment-topology/'` " />
+ </set>
+ <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>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.connection-attachment-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$mdsal-ar.connection-attachment-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name='connection-attachment-ar.' value='$mdsal-ar.connection-attachment-allotted-resource[0].' />
+ </set>
+ <switch test='`$connection-attachment-ar.allotted-resource-data.allotted-resource-oper-status.order-status`'>
+ <outcome value='Active'>
+ <block></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="`'Existing connection-attachment-allotted-resource with order status of ' + $connection-attachment-ar.allotted-resource-data.allotted-resource-oper-status.order-status + '.'`" />
+ </return>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$connection-attachment-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$connection-attachment-ar.allotted-resource-status.rpc-action`' />
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$connection-attachment-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: SOTN resource not found" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: SOTN resource not found" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='sdwan-get-saved-ar-param' mode='sync' ></call>
+ </block>
+ <set>
+ <parameter name='tmp.ar.parent-service-instance-id' value="`$connection-attachment-topology-operation-input.allotted-resource-information.parent-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"/>
+ <parameter name="outputPath" value="tmp.ar-url-psd"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url-psd`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-psd" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: SOTN resource not found" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='prop.siteAttachements_length' value='0' />
+ <parameter name='prop.siteIds_length' value='0' />
+ </set>
+ <for index='pidx' start='0' end='`$mdsal-psd.service-data.provided-allotted-resources.provided-allotted-resource_length`' >
+ <block atomic="true">
+ <switch test="`$prop.ar.provided-allotted-resource-id == $tmp.ar.allotted-resource-id`">
+ <outcome value='false'>
+ <block atomic="true">
+ <set>
+ <parameter name='prop.ar.provided-allotted-resource-id' value='`$mdsal-psd.service-data.provided-allotted-resources.provided-allotted-resource[$pidx].allotted-resource-id`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.connection-attachment-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url-connection"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$prop.ar.provided-allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url-connection`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-providedAr" />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <for index="aridx" start="0" end="`$mdsal-providedAr.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[$aridx].name == 'Role'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.role' value='`$mdsal-providedAr.connection-attachment-allotted-resource[0].allotted-resource-data.allotted-resource-operation-information.connection-attachment-request-input.param[$aridx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$mdsal-providedAr.connection-attachment-allotted-resource[0].allotted-resource-data.allotted-resource-operation-information.connection-attachment-request-input.param[$aridx].name == 'sdwanVpnName'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.name' value='`$mdsal-providedAr.connection-attachment-allotted-resource[0].allotted-resource-data.allotted-resource-operation-information.connection-attachment-request-input.param[$aridx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <set>
+ <parameter name='prop.ar-parent-service-instance-id' value='`$mdsal-providedAr.connection-attachment-allotted-resource[0].allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.parent-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"/>
+ <parameter name="outputPath" value="tmp.ar-url-connection"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$prop.ar-parent-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url-connection`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-parentsd" />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <for index='pnidx' start='0' end='`$mdsal-parentsd.service-data.networks.network_length`' >
+ <block>
+ <switch test="`$mdsal-parentsd.service-data.networks.network[$pnidx].network-data.request-information.request-action == 'ActivateSDWANConnectivityInstance'`">
+ <outcome value='true'>
+ <block atomic="true">
+ <for index="paramidx" start="0" end="`$mdsal-parentsd.service-data.networks.network[$pnidx].network-data.network-request-input.network-input-parameters.param_length`">
+ <block>
+ <switch test="`$mdsal-psd.service-data.networks.network[$pnidx].network-data.network-request-input.network-input-parameters.param[$paramidx].name == 'topology'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.topology' value='`$mdsal-psd.service-data.networks.network[$pnidx].network-data.network-request-input.network-input-parameters.param[$paramidx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$mdsal-psd.service-data.networks.network[$pnidx].network-data.network-request-input.network-input-parameters.param[$paramidx].name == 'vpnId'`">
+ <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`' />
+ </set>
+ </outcome>
+ </switch>
+ </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`' />
+ </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"/>
+ <parameter name="outputPath" value="tmp.ar-url-connection"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$prop.ar-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url-connection`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-sd" />
+ <outcome value='Other'>
+ <block></block>
+ </outcome>
+ <outcome value='success'>
+ <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`">
+ <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`">
+ <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'`">
+ <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`' />
+ </set>
+ <set>
+ <parameter name='prop.siteIds[$prop.siteIds_length]' value='`$prop.attach.siteId`' />
+ <parameter name='prop.siteIds_length' value='`$prop.siteIds_length + 1`' />
+ <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' />
+ <parameter name='prop.siteAttachements_length' value='`$prop.siteAttachements_length + 1`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </execute>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="esr-thirdparty-sdnc"
+ key="esr-thirdparty-sdnc.thirdparty-sdnc-id = SDWAN-Controller AND
+ depth = '1'"
+ pfx='tmp.aai.esr-thirdparty-sdnc' local-only='false' >
+ <outcome value='success'>
+ <set>
+ <parameter name='prop.sdncRestApi.thirdpartySdnc.url' value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].service-url`" />
+ <parameter name='prop.sdncRestApi.thirdpartySdnc.user' value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].user-name`" />
+ <parameter name='prop.sdncRestApi.thirdpartySdnc.password' value="`$tmp.aai.esr-thirdparty-sdnc.esr-system-info-list.esr-system-info[0].password`" />
+ </set>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'An error occurred while querying esr-thirdparty-sdnc from AnAI with thirdparty-sdnc-id = ' + $tmp.thirdparty-sdnc-id`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Unexpected error occurred while querying esr-thirdparty-sdnc from AnAI with thirdparty-sdnc-id = ' + $tmp.thirdparty-sdnc-id`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <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="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`" />
+ <parameter name="format" value="json"/>
+ <parameter name="httpMethod" value="put"/>
+ <parameter name="responsePrefix" value="vpn-result"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.openecomp.client.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <parameter name='customHttpHeaders' value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`" />
+ <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>
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/sdwan-vpn.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/controller/campus/v1/sdwan/overlay-network/vpn'`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json"/>
+ <parameter name="httpMethod" value="put"/>
+ <parameter name="responsePrefix" value="vpn-result"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.openecomp.client.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <parameter name='customHttpHeaders' value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`" />
+ <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>
+ <outcome value='success'>
+ <block atomic="true"></block>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='connection-attachment-ar.allotted-resource-status.action' value="`$connection-attachment-topology-operation-input.request-information.request-action` " />
+ <parameter name='connection-attachment-ar.allotted-resource-status.rpc-name' value="connection-attachment-topology-operation" />
+ <parameter name='connection-attachment-ar.allotted-resource-status.rpc-action' value="`$connection-attachment-topology-operation-input.sdnc-request-header.svc-action` " />
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$connection-attachment-topology-operation-input.request-information.` " />
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$connection-attachment-topology-operation-input.sdnc-request-header.` " />
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$connection-attachment-topology-operation-input.service-information.` " />
+ </set>
+ <set>
+ <parameter name='connection-attachment-ar.allotted-resource-data.connection-attachment-topology.onap-model-information.' value="`$connection-attachment-topology-operation-input.allotted-resource-information.onap-model-information.` " />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
+ <parameter name="outputPath" value="tmp.current-time" />
+ </execute>
+ <set>
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingDelete' />
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$connection-attachment-topology-operation-input.request-information.request-action`' />
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$connection-attachment-topology-operation-input.sdnc-request-header.svc-action`' />
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$connection-attachment-topology-operation-input.sdnc-request-header.svc-request-id`' />
+ <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sdwan-attachment.templatefile`" />
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='PUT' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block></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 updating md-sal for connection-attachment-allotted-resource" />
+ </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="Error updating md-sal for connection-attachment-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+ <parameter name='connection-attachment-object-path' value="`$tmp.ar.self-link`"/>
+ <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $connection-attachment-topology-operation-input.service-information.service-instance-id
+ + '/service-data/service-topology/'`"/>
+ </set>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-attachment-topology-operation-delete.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-attachment-topology-operation-delete.xml new file mode 100644 index 00000000..29e1a5e6 --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-attachment-topology-operation-delete.xml @@ -0,0 +1,185 @@ +<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-attachment-topology-operation-delete' mode='sync'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.ar.allotted-resource-id' value='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
+ <parameter name='tmp.ar.parent-service-instance-id' value='`$connection-attachment-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:connection-attachment-allotted-resources/connection-attachment-allotted-resource/'
+ + $tmp.ar.allotted-resource-id
+ + '/allotted-resource-data/connection-attachment-topology/'` " />
+ </set>
+ <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>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.connection-attachment-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='Delete' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block></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 updating md-sal for connection-attachment-allotted-resource" />
+ </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="Error updating md-sal for connection-attachment-allotted-resource" />
+ </return>
+ </outcome>
+ </execute>
+ <switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Resource to be deleted doesn't exist in MDSAL." />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='cidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' >
+ <switch test="`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].allotted-resource-id == $tmp.ar.allotted-resource-id`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.cidx' value='`$cidx`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.cidx`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="resource to be deleted is not available in mdsal" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx]." value="" />
+ <parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length - 1`' />
+ </set>
+ <set>
+ <parameter name='tmp.ar.parent-service-instance-id' value="`$connection-attachment-topology-operation-input.allotted-resource-information.parent-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"/>
+ <parameter name="outputPath" value="tmp.ar-url-psd"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$tmp.ar.parent-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url-psd`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-psd" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: SOTN resource not found" />
+ </return>
+ </outcome>
+ </execute>
+ <switch test='`$mdsal-psd.service-data.provided-allotted-resources.provided-allotted-resource_length`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Resource to be deleted doesn't exist in MDSAL." />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <for index='pidx' start='0' end='`$mdsal-psd.service-data.provided-allotted-resources.provided-allotted-resource_length`' >
+ <switch test="`$mdsal-psd.service-data.provided-allotted-resources.provided-allotted-resource[$pidx].allotted-resource-id == $tmp.ar.allotted-resource-id`">
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='tmp.pidx' value='`$pidx`' />
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </for>
+ <switch test="`$tmp.pidx`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="resource to be deleted is not available in mdsal" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ <set>
+ <parameter name="service-data.provided-allotted-resources.consumed-allotted-resource[$pidx]." value="" />
+ <parameter name="service-data.provided-allotted-resources.consumed-allotted-resource_length" value='`$service-data.provided-allotted-resources.consumed-allotted-resource_length - 1`' />
+ </set>
+ <set>
+ <parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
+ <parameter name='connection-attachment-object-path' value="`$tmp.ar.self-link`"/>
+ <parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ + $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" />
+ <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-get-saved-ar-param.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-get-saved-ar-param.xml new file mode 100644 index 00000000..d9bce9b6 --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-get-saved-ar-param.xml @@ -0,0 +1,31 @@ +<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-get-saved-ar-param' mode='sync'>
+ <block atomic="true">
+ <for index='idx' start='0' end='`$connection-attachment-ar.allotted-resource-data.allotted-resource-operation-information.connection-attachment-request-input.param_length`' >
+ <block>
+ <switch test="`$connection-attachment-ar.allotted-resource-data.allotted-resource-operation-information.connection-attachment-request-input.param[$idx].name == 'sdwanVpnName'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.connection-attachment.sdwanVpnName' value='`$connection-attachment-ar.allotted-resource-data.allotted-resource-operation-information.connection-attachment-request-input.param[$idx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$connection-attachment-ar.allotted-resource-data.allotted-resource-operation-information.connection-attachment-request-input.param[$idx].name == 'role'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.connection-attachment.role' value='`$connection-attachment-ar.allotted-resource-data.allotted-resource-operation-information.connection-attachment-request-input.param[$idx].value`' />
+ </set>
+ </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>
+ </for>
+ </block>
+ </method>
+</service-logic>
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-network-topology-operation-activate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-network-topology-operation-activate.xml index e9880582..30e20974 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-network-topology-operation-activate.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-network-topology-operation-activate.xml @@ -87,56 +87,65 @@ key= 'service-subscription.service-type = $service-data.networks.network[$tmp.nidx].network-data.service-information.subscription-service-type
AND customer.global-customer-id = $service-data.networks.network[$tmp.nidx].network-data.service-information.global-customer-id'
force="true" pfx="tmp.AnAI-data">
- <switch test='`$tmp.AnAI-data.temp-ub-sub-account-id`'>
- <outcome value=''>
- <block atomic="true">
- <set>
- <parameter name='prop.customer-id' value='`$ctx.network-data.service-information.global-customer-id`' />
- </set>
- <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ <outcome value='success'>
+ <switch test='`$tmp.AnAI-data.temp-ub-sub-account-id`'>
+ <outcome value=''>
+ <block atomic="true">
+ <set>
+ <parameter name='prop.customer-id' value='`$ctx.network-data.service-information.global-customer-id`' />
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="service-subscription"
key= 'service-subscription.service-type = $service-data.networks.network[$tmp.nidx].network-data.service-information.subscription-service-type
AND customer.global-customer-id = $service-data.networks.network[$tmp.nidx].network-data.service-information.global-customer-id'>
- <parameter name='temp-ub-sub-account-id' value='`$prop.customer-id`' />
- </save>
- <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/sdwan-tenant.json'`" />
- <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/controller/campus/v1/baseservice/tenanats'`" />
- <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
- <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
- <parameter name="format" value="json"/>
- <parameter name="httpMethod" value="put"/>
- <parameter name="responsePrefix" value="tenant-result"/>
- <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.openecomp.client.jks"/>
- <parameter name="trustStorePassword" value="adminadmin"/>
- <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
- <parameter name="keyStorePassword" value="adminadmin"/>
- <parameter name='customHttpHeaders' value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`" />
- </execute>
+ <parameter name='temp-ub-sub-account-id' value='`$prop.customer-id`' />
+ </save>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/sdwan-tenant.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/controller/campus/v1/baseservice/tenanats'`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json"/>
+ <parameter name="httpMethod" value="put"/>
+ <parameter name="responsePrefix" value="tenant-result"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.openecomp.client.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <parameter name='customHttpHeaders' value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`" />
+ </execute>
+ <set>
+ <parameter name='prop.tenant-id' value='`$tenant-result.data.tenantId`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/controller/campus/v1/baseservice/tenanats/authorization/' + $prop.tenant-id`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json"/>
+ <parameter name="httpMethod" value="put"/>
+ <parameter name="responsePrefix" value="tenant-result"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.openecomp.client.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <parameter name='customHttpHeaders' value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`" />
+ </execute>
+ </block>
+ </outcome>
+ <outcome value='Other'>
<set>
- <parameter name='prop.tenant-id' value='`$tenant-result.data.tenantId`' />
+ <parameter name='prop.tenant-id' value='`$tmp.AnAI-data.temp-ub-sub-account-id`' />
</set>
- <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/controller/campus/v1/baseservice/tenanats/authorization/' + $prop.tenant-id`" />
- <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
- <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
- <parameter name="format" value="json"/>
- <parameter name="httpMethod" value="put"/>
- <parameter name="responsePrefix" value="tenant-result"/>
- <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.openecomp.client.jks"/>
- <parameter name="trustStorePassword" value="adminadmin"/>
- <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
- <parameter name="keyStorePassword" value="adminadmin"/>
- <parameter name='customHttpHeaders' value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`" />
- </execute>
- </block>
- </outcome>
- <outcome value='Other'>
- <set>
- <parameter name='prop.tenant-id' value='`$tmp.AnAI-data.temp-ub-sub-account-id`' />
- </set>
- </outcome>
- </switch>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing get token rest api" />
+ </return>
+ </outcome>
</get-resource>
<block atomic="true">
<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
@@ -170,8 +179,9 @@ <parameter name='customHttpHeaders' value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`" />
</execute>
<set>
- <parameter name='prop.vpn-id' value='`$vpn-result.id`' />
- <parameter name='prop.vpn1Id' value='`$vpn-result.id`' />
+ <!--parameter name='prop.vpn-id' value='`$vpn-result.id`' /><parameter name='prop.vpn1Id' value='`$vpn-result.id`' /-->
+ <parameter name='prop.vpn-id' value='10' />
+ <parameter name='prop.vpn1Id' value='10' />
</set>
<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
<parameter name="templateFileName" value="`$prop.restapi.templateDir + '/sdwan-vpn-topology.json'`" />
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 new file mode 100644 index 00000000..9db916e0 --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sdwan-wanport-vnf-topology-operation-underlay.xml @@ -0,0 +1,640 @@ +<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-wanport-vnf-topology-operation-underlay' mode='sync'>
+ <block atomic="true">
+ <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`' >
+ <block atomic="true">
+ <set>
+ <parameter name='prop.ar.allotted-resource-id' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].allotted-resource-id`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.connection-attachment-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url-connection"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$prop.ar.allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url-connection`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-ar" />
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test='`$mdsal-ar.connection-attachment-allotted-resource_length`'>
+ <outcome value='1'>
+ <block atomic='true'>
+ <set>
+ <parameter name='prop.parent-service-instance-id' value='`$mdsal-ar.connection-attachment-allotted-resource[0].allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.parent-service-instance-id`' />
+ </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'`">
+ <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`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Connection attachement resource not found" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <block atomic="true">
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: Connection attachement resource not found" />
+ </return>
+ </block>
+ </outcome>
+ </execute>
+ <switch test="`$prop.spoke.role == 'spoke'`">
+ <outcome value='true'>
+ <block atomic="true">
+ <for index='i' start='0' end='`$service-data.vnfs.vnf_length`' >
+ <block atomic="true">
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.request-information.request-action == 'ActivateSDWANPortInstance'`">
+ <outcome value='true'>
+ <block atomic="true">
+ <for index="widx" 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[$widx].name == 'transportNetworkName'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.spoke.transportNetworkName' value='`$service-data.vnfs.vnf[$i].vnf-data.vnf-request-input.vnf-input-parameters.param[$widx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vnf-request-input.vnf-input-parameters.param[$widx].name == 'wanPortId'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.spoke.wanPortId' value='`$service-data.vnfs.vnf[$i].vnf-data.vnf-request-input.vnf-input-parameters.param[$widx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vnf-request-input.vnf-input-parameters.param[$widx].name == 'providerIpAddress'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.spoke.providerIpAddress' value='`$service-data.vnfs.vnf[$i].vnf-data.vnf-request-input.vnf-input-parameters.param[$widx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vnf-request-input.vnf-input-parameters.param[$widx].name == 'ipAddress'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.spoke.ipAddress' value='`$service-data.vnfs.vnf[$i].vnf-data.vnf-request-input.vnf-input-parameters.param[$widx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.request-information.request-action == 'ActivateSDWANDeviceInstance'`">
+ <outcome value='true'>
+ <block atomic="true">
+ <for index="didx" 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[$didx].name == 'deviceId'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.spoke.deviceId' value='`$service-data.vnfs.vnf[$i].vnf-data.vnf-request-input.vnf-input-parameters.param[$didx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.request-information.request-action == 'ActivateSiteInstance'`">
+ <outcome value='true'>
+ <block atomic="true">
+ <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'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.spoke.siteName' value='`$service-data.vnfs.vnf[$i].vnf-data.vnf-request-input.vnf-input-parameters.param[$sidx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$service-data.vnfs.vnf[$i].vnf-data.vnf-request-input.vnf-input-parameters.param[$sidx].name == 'siteId'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.spoke.siteId' value='`$service-data.vnfs.vnf[$i].vnf-data.vnf-request-input.vnf-input-parameters.param[$sidx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <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"/>
+ <parameter name="outputPath" value="tmp.ar-url-parent-connection"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$prop.parent-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url-parent-connection`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-psd" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: SOTN resource not found" />
+ </return>
+ </outcome>
+ </execute>
+ <for index='pnidx' start='0' end='`$mdsal-psd.service-data.networks.network_length`' >
+ <block atomic="true">
+ <switch test="`$mdsal-psd.service-data.networks.network[$pnidx].network-data.request-information.request-action == 'ActivateSDWANConnectivityInstance'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.pnidx' value='`$pnidx`' />
+ </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>
+ <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'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.topology' value='`$mdsal-psd.service-data.networks.network[$tmp.pnidx].network-data.network-request-input.network-input-parameters.param[$paramidx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$mdsal-psd.service-data.networks.network[$tmp.pnidx].network-data.network-request-input.network-input-parameters.param[$paramidx].name == 'vpnId'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.vpnId' value='`$mdsal-psd.service-data.networks.network[$tmp.pnidx].network-data.network-request-input.network-input-parameters.param[$paramidx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$prop.topology == 'hub-spoke'`">
+ <outcome value='false'>
+ <block></block>
+ </outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <for index='ppidx' start='0' end='`$mdsal-psd.service-data.provided-allotted-resources.provided-allotted-resource_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='prop.ar.provided-allotted-resource-id' value='`$mdsal-psd.service-data.provided-allotted-resources.provided-allotted-resource[$ppidx].allotted-resource-id`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
+ <parameter name="source" value="`$prop.restapi.connection-attachment-allottedresource`"/>
+ <parameter name="outputPath" value="tmp.ar-url-connection"/>
+ <parameter name="target" value="{allotted-resource-id}"/>
+ <parameter name="replacement" value="`$prop.ar.provided-allotted-resource-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url-connection`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-providedAr" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: SOTN resource not found" />
+ </return>
+ </outcome>
+ </execute>
+ <for index="aridx" start="0" end="`$mdsal-providedAr.connection-attachment-allotted-resource[0].allotted-resource-data.allotted-resource-operation-information.connection-attachment-request-input.param_length`">
+ <block atomic="true">
+ <switch test="`$mdsal-providedAr.connection-attachment-allotted-resource[0].allotted-resource-data.allotted-resource-operation-information.connection-attachment-request-input.param[$aridx].name == 'Role'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.role' value='`$mdsal-providedAr.connection-attachment-allotted-resource[0].allotted-resource-data.allotted-resource-operation-information.connection-attachment-request-input.param[$aridx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$prop.role == hub`">
+ <outcome value='false'>
+ <block></block>
+ </outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <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"/>
+ <parameter name="outputPath" value="tmp.ar-url-connection"/>
+ <parameter name="target" value="{service-instance-id}"/>
+ <parameter name="replacement" value="`$prop.ar-service-instance-id`"/>
+ </execute>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url-connection`' />
+ <parameter name='restapiUser' value='`$prop.controller.user`' />
+ <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
+ <parameter name='format' value='json' />
+ <parameter name='httpMethod' value='GET' />
+ <parameter name="responsePrefix" value="mdsal-arsd" />
+ <outcome value='success'>
+ <block></block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="404" />
+ <parameter name="error-message" value="Error: SDWAN service-data not found" />
+ </return>
+ </outcome>
+ </execute>
+ <for index='arvidx' start='0' end='`$mdsal-arsd.service-data.vnfs.vnf_length`' >
+ <block atomic="true">
+ <switch test="`$mdsal-arsd.service-data.vnfs.vnf[$arvidx].vnf-data.request-information.request-action == 'ActivateSDWANPortInstance'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.portvidx' value='`$arvidx`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$mdsal-arsd.service-data.vnfs.vnf[$arvidx].vnf-data.request-information.request-action == 'ActivateSDWANDeviceInstance'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.devicevidx' value='`$arvidx`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$mdsal-arsd.service-data.vnfs.vnf[$arvidx].vnf-data.request-information.request-action == 'ActivateSiteInstance'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='tmp.sitevidx' value='`$arvidx`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <block atomic="true">
+ <switch test="`$tmp.portvidx`">
+ <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 (port) not found in service-data" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.devicevidx`">
+ <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 (device) not found in service-data" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test="`$tmp.sitevidx`">
+ <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 (site) not found in service-data" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ <for index="wportidx" start="0" end="`$mdsal-arsd.service-data.vnfs.vnf[$tmp.portvidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length`">
+ <block atomic="true">
+ <switch test="`$mdsal-arsd.service-data.vnfs.vnf[$tmp.portvidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$wportidx].name == 'transportNetworkName'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.hub.transportNetworkName' value='`$mdsal-arsd.service-data.vnfs.vnf[$tmp.portvidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$wportidx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$mdsal-arsd.service-data.vnfs.vnf[$tmp.portvidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$wportidx].name == 'wanPortId'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.hub.wanPortId' value='`$mdsal-arsd.service-data.vnfs.vnf[$tmp.portvidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$wportidx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$mdsal-arsd.service-data.vnfs.vnf[$tmp.portvidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$wportidx].name == 'providerIpAddress'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.hub.providerIpAddress' value='`$mdsal-arsd.service-data.vnfs.vnf[$tmp.portvidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$wportidx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$mdsal-arsd.service-data.vnfs.vnf[$tmp.portvidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$wportidx].name == 'ipAddress'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.hub.ipAddress' value='`$mdsal-arsd.service-data.vnfs.vnf[$tmp.portvidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$wportidx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <switch test="`$prop.hub.transportNetworkName == $prop.spoke.transportNetworkName`">
+ <outcome value='false'>
+ <block></block>
+ </outcome>
+ <outcome value='true'>
+ <block atomic="true">
+ <set>
+ <parameter name='prop.hubTnpId' value='$prop.hub.wanPortId' />
+ </set>
+ <for index="deviceidx" start="0" end="`$mdsal-arsd.service-data.vnfs.vnf[$tmp.devicevidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length`">
+ <block atomic="true">
+ <switch test="`$mdsal-arsd.service-data.vnfs.vnf[$tmp.devicevidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$deviceidx].name == 'deviceId'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.hub.deviceId' value='`$mdsal-arsd.service-data.vnfs.vnf[$tmp.devicevidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$deviceidx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <for index="siteidx" start="0" end="`$mdsal-arsd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param_length`">
+ <block atomic="true">
+ <switch test="`$mdsal-arsd.service-data.vnfs.vnf[$tmp.sitevidx].vnf-data.vnf-request-input.vnf-input-parameters.param[$siteidx].name == 'name'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.hub.siteName' 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 == 'siteId'`">
+ <outcome value='true'>
+ <set>
+ <parameter name='prop.hub.siteId' 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 == '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`'>
+ <outcome value='ActivateSDWANAttachmentInstance'>
+ <block atomic="true">
+ <set>
+ <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.ipAddress' value='`$prop.hub.ipAddress`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/sdwan-underlay.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/controller/campus/v1/sdwan/routing-protocol/static'`" />
+ <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="underlayHubResp"/>
+ <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='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing sdwan hub route underlay rest api" />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </execute>
+ <set>
+ <parameter name='prop.route.vpnId' value='`$prop.vpnId`' />
+ <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.ipAddress' value='`$prop.spoke.ipAddress`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/sdwan-underlay.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/controller/campus/v1/sdwan/routing-protocol/static'`" />
+ <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="underlayspokeResp"/>
+ <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='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing sdwan spoke route underlay rest api" />
+ </return>
+ </outcome>
+ <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`' />
+ </set>
+ </block>
+ </outcome>
+ <outcome value='DeactivateSDWANAttachmentInstance'>
+ <block atomic="true">
+ <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.ipAddress' value='`$prop.hub.ipAddress`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/sdwan-underlay.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/controller/campus/v1/sdwan/routing-protocol/static/action/batch-delete'`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json"/>
+ <parameter name="httpMethod" value="post"/>
+ <parameter name="responsePrefix" value="underlayHubResp"/>
+ <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='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing sdwan hub route underlay rest api" />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </execute>
+ <set>
+ <parameter name='prop.route.id' value='`$prop.spokeRouteId`' />
+ <parameter name='prop.route.vpnId' value='`$prop.vpnId`' />
+ <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.ipAddress' value='`$prop.spoke.ipAddress`' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/sdwan-underlay.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/controller/campus/v1/sdwan/routing-protocol/static/action/batch-delete'`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json"/>
+ <parameter name="httpMethod" value="post"/>
+ <parameter name="responsePrefix" value="underlayspokeResp"/>
+ <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='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing sdwan spoke route underlay rest api" />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </execute>
+ </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>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <for index='providx' start='0' end='`$prop.provision.siteIds_length`' >
+ <block atomic="true">
+ <set>
+ <parameter name='prop.provision.hubSitename' value='`$prop.provision.siteIds[$providx].hubSiteName`' />
+ <parameter name='prop.provision.spokeSitename' value='`$prop.provision.siteIds[$providx].spokeSiteName`' />
+ <parameter name='prop.provision.hubspokesite[0]' value='`$prop.provision.siteIds[$providx].hubSiteId`' />
+ <parameter name='prop.provision.hubspokesite[1]' value='`$prop.provision.siteIds[$providx].spokeSiteId`' />
+ <parameter name='prop.provision.hubspokesite_length' value='2' />
+ </set>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/sdwan-site-provision.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/controller/campus/v1/sdwan/net/sites/provision-urls'`" />
+ <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="provisionUrlRsp"/>
+ <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='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing provision url rest api" />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </execute>
+ <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`'/>
+ </record>
+ </block>
+ </for>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ </return>
+ </block>
+ </method>
+</service-logic>
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-connection-attachment-input.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-connection-attachment-input.xml index 3359ece8..ec0301a7 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-connection-attachment-input.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-connection-attachment-input.xml @@ -1,236 +1,331 @@ -<service-logic - xmlns='http://www.onap.org/sdnc/svclogic' - xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'> - <method rpc='validate-connection-attachment-input' mode='sync'> - <block atomic="true"> - <switch test='`$connection-attachment-topology-operation-input.sdnc-request-header.svc-action`'> - <outcome value=''> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" /> - </return> - </outcome> - </switch> - <switch test='`$connection-attachment-topology-operation-input.service-information.service-instance-id`'> - <outcome value=''> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="service-information.service-instance-id is a required input" /> - </return> - </outcome> - </switch> - <switch test='`$connection-attachment-topology-operation-input.allotted-resource-information.parent-service-instance-id`'> - <outcome value=''> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="service-information.parent-service-instance-id is a required input" /> - </return> - </outcome> - </switch> - <switch test='`$connection-attachment-topology-operation-input.sdnc-request-header.svc-action`'> - <outcome value='create'> - <block atomic="true"> - <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'> - <outcome value='CreateSOTNAttachmentInstance'> - <block atomic="true"> - <for index="i" start="0" end="`$connection-attachment-topology-operation-input.connection-attachment-request-input.param_length`"> - <block> - <set> - <parameter name='tmp.name' value='' /> - <parameter name='tmp.value' value='' /> - </set> - <set> - <parameter name='tmp.name' value="`$connection-attachment-topology-operation-input.connection-attachment-request-input.param[$i].name`"/> - <parameter name='tmp.value' value="`$connection-attachment-topology-operation-input.connection-attachment-request-input.param[$i].value`"/> - </set> - <switch test="`$tmp.name`"> - <outcome value='sotnVpnName'> - <switch test="`$tmp.value`"> - <outcome value=''> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="`'$tmp.name +' is a required input'`" /> - </return> - </outcome> - </switch> - </outcome> - <outcome value='clientSignal'> - <switch test="`$tmp.value`"> - <outcome value=''> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="`'$tmp.name +' is a required input'`" /> - </return> - </outcome> - </switch> - </outcome> - <outcome value='access-provider-id'> - <switch test="`$tmp.value`"> - <outcome value=''> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="`'$tmp.name +' is a required input'`" /> - </return> - </outcome> - </switch> - </outcome> - <outcome value='access-client-id'> - <switch test="`$tmp.value`"> - <outcome value=''> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="`'$tmp.name +' is a required input'`" /> - </return> - </outcome> - </switch> - </outcome> - <outcome value='access-topology-id'></outcome> - <outcome value='access-node-id'> - <switch test="`$tmp.value`"> - <outcome value=''> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="`'$tmp.name +' is a required input'`" /> - </return> - </outcome> - </switch> - </outcome> - <outcome value='cVLAN'> - <switch test="`$tmp.value`"> - <outcome value=''> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="`'$tmp.name +' is a required input'`" /> - </return> - </outcome> - </switch> - </outcome> - <outcome value=''> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="`'network-topology-operation-input.network-request-input.network-input-parameters.param[' + $i + ']' + '.name is a required input'`" /> - </return> - </outcome> - </switch> - </block> - </for> - </block> - </outcome> - <outcome value='other'> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="sdnc-request-header.request-action is invalid" /> - </return> - </outcome> - </switch> - </block> - </outcome> - <outcome value='activate'> - <block atomic="true"> - <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'> - <outcome value='ActivateSOTNAttachmentInstance'> - <block atomic="true"> - <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' > - <parameter name="connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id" value="$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id"/> - </execute> - <switch test='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id`'> - <outcome value=''> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" /> - </return> - </outcome> - </switch> - </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="sdnc-request-header.request-action is invalid" /> - </return> - </outcome> - </switch> - </block> - </outcome> - <outcome value='deactivate'> - <block atomic="true"> - <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'> - <outcome value='DeactivateSOTNAttachmentInstance'> - <block atomic="true"> - <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' > - <parameter name="connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id" value="$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id"/> - </execute> - <switch test='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id`'> - <outcome value=''> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" /> - </return> - </outcome> - </switch> - </block> - </outcome> - <outcome value='Other'> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="request-information.request-action is required to be DeleteNetworkInstance for svc-action=delete" /> - </return> - </outcome> - </switch> - </block> - </outcome> - <outcome value='delete'> - <block atomic="true"> - <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'> - <outcome value='DeleteSOTNAttachmentInstance'> - <block atomic="true"> - <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' > - <parameter name="connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id" value="$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id"/> - </execute> - <switch test='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id`'> - <outcome value=''> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" /> - </return> - </outcome> - </switch> - </block> - </outcome> - <outcome value='Other'> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="request-information.request-action is required to be DeleteNetworkInstance for svc-action=delete" /> - </return> - </outcome> - </switch> - </block> - </outcome> - <outcome value='Other'> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="error-code" value="500" /> - <parameter name="error-message" value="`$network-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" /> - </return> - </outcome> - </switch> - </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='validate-connection-attachment-input' mode='sync'>
+ <block atomic="true">
+ <switch test='`$connection-attachment-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$connection-attachment-topology-operation-input.service-information.service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$connection-attachment-topology-operation-input.allotted-resource-information.parent-service-instance-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="service-information.parent-service-instance-id is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ <switch test='`$connection-attachment-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='create'>
+ <block atomic="true">
+ <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateSOTNAttachmentInstance'>
+ <block atomic="true">
+ <for index="i" start="0" end="`$connection-attachment-topology-operation-input.connection-attachment-request-input.param_length`">
+ <block>
+ <set>
+ <parameter name='tmp.name' value='' />
+ <parameter name='tmp.value' value='' />
+ </set>
+ <set>
+ <parameter name='tmp.name' value="`$connection-attachment-topology-operation-input.connection-attachment-request-input.param[$i].name`"/>
+ <parameter name='tmp.value' value="`$connection-attachment-topology-operation-input.connection-attachment-request-input.param[$i].value`"/>
+ </set>
+ <switch test="`$tmp.name`">
+ <outcome value='sotnVpnName'>
+ <switch test="`$tmp.value`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='clientSignal'>
+ <switch test="`$tmp.value`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='access-provider-id'>
+ <switch test="`$tmp.value`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='access-client-id'>
+ <switch test="`$tmp.value`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='access-topology-id'></outcome>
+ <outcome value='access-node-id'>
+ <switch test="`$tmp.value`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='cVLAN'>
+ <switch test="`$tmp.value`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-topology-operation-input.network-request-input.network-input-parameters.param[' + $i + ']' + '.name is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='CreateSDWANAttachmentInstance'>
+ <block atomic="true">
+ <for index="i" start="0" end="`$connection-attachment-topology-operation-input.connection-attachment-request-input.param_length`">
+ <block>
+ <set>
+ <parameter name='tmp.name' value='' />
+ <parameter name='tmp.value' value='' />
+ </set>
+ <set>
+ <parameter name='tmp.name' value="`$connection-attachment-topology-operation-input.connection-attachment-request-input.param[$i].name`"/>
+ <parameter name='tmp.value' value="`$connection-attachment-topology-operation-input.connection-attachment-request-input.param[$i].value`"/>
+ </set>
+ <switch test="`$tmp.name`">
+ <outcome value='sdwanVpnName'>
+ <switch test="`$tmp.value`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='role'>
+ <switch test="`$tmp.value`">
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'$tmp.name +' is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'network-topology-operation-input.network-request-input.network-input-parameters.param[' + $i + ']' + '.name is a required input'`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </outcome>
+ <outcome value='other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="sdnc-request-header.request-action is invalid" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='activate'>
+ <block atomic="true">
+ <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'>
+ <outcome value='ActivateSOTNAttachmentInstance'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' >
+ <parameter name="connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id" value="$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id"/>
+ </execute>
+ <switch test='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='ActivateSDWANAttachmentInstance'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' >
+ <parameter name="connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id" value="$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id"/>
+ </execute>
+ <switch test='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </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="sdnc-request-header.request-action is invalid" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='deactivate'>
+ <block atomic="true">
+ <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeactivateSDWANAttachmentInstance'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' >
+ <parameter name="connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id" value="$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id"/>
+ </execute>
+ <switch test='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='DeactivateSOTNAttachmentInstance'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' >
+ <parameter name="connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id" value="$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id"/>
+ </execute>
+ <switch test='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is required to be DeleteNetworkInstance for svc-action=delete" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='delete'>
+ <block atomic="true">
+ <switch test='`$connection-attachment-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteSOTNAttachmentInstance'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' >
+ <parameter name="connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id" value="$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id"/>
+ </execute>
+ <switch test='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='DeleteSDWANAttachmentInstance'>
+ <block atomic="true">
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='requiredParameters' >
+ <parameter name="connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id" value="$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id"/>
+ </execute>
+ <switch test='`$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="network-request-input.network-input-parameters.name is a required input" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="request-information.request-action is required to be DeleteNetworkInstance for svc-action=delete" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$network-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
|