diff options
author | shashikanth.vh <shashikanth.vh@huawei.com> | 2018-08-09 14:08:39 +0530 |
---|---|---|
committer | Shashikanth VH <shashikanth.vh@huawei.com> | 2018-08-09 16:30:50 +0000 |
commit | 74c1c3507bbd3194c7bb57e45ffd08428dd280c2 (patch) | |
tree | 0b4cbec0998c59a80d5fc79a436b28da99dc5bf5 /platform-logic/generic-resource-api/src/main/xml | |
parent | bdf9859eb3df68fea82e938b9ed7584b4787657d (diff) |
connectivity attachment issue fix
Test issues fixed
Change-Id: I991876c6176c5fa05682e635b9c1e29eb5b08d54
Issue-ID: SDNC-356
Signed-off-by: shashikanth.vh <shashikanth.vh@huawei.com>
Former-commit-id: e89a860588e3a094d5cc251dd6992373c2f36ab7
Diffstat (limited to 'platform-logic/generic-resource-api/src/main/xml')
6 files changed, 1766 insertions, 1687 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 c5d13775..ff587ce8 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,82 @@ -<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='delete'>
- <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='deactivate'>
- <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 + 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 diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sotn-attachment-topology-operation-activate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sotn-attachment-topology-operation-activate.xml index 8d9c12e4..23b28c85 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sotn-attachment-topology-operation-activate.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sotn-attachment-topology-operation-activate.xml @@ -1,570 +1,599 @@ -<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='sotn-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>
- <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='GENERIC-RESOURCE-API' key='connection-attachment-allotted-resources/connection-attachment-allotted-resource/$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id/' pfx='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: 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>
- </get-resource>
- <block atomic="true">
- <call module='GENERIC-RESOURCE-API' rpc='connection-attachment-get-request-input-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>
- <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='GENERIC-RESOURCE-API' key='services/service/$tmp.ar.parent-service-instance-id/service-data' pfx='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>
- </get-resource>
- <set>
- <parameter name='tmp.found-in-ar' value='false' />
- <parameter name='tmp.found-in-network' value='false' />
- <parameter name='tmp.ep-available' value='false' />
- </set>
- <switch test='`$mdsal-psd.provided-allotted-resources.provided-allotted-resource_length`'>
- <outcome value='2'>
- <block atomic="true">
- <for index='pidx' start='0' end='`$mdsal-psd.provided-allotted-resources.provided-allotted-resource_length`' >
- <switch test="`$mdsal-psd.provided-allotted-resources.provided-allotted-resource[$cidx].allotted-resource-id == $tmp.ar.allotted-resource-id`">
- <outcome value='true'>
- <block></block>
- </outcome>
- <outcome value='false'>
- <block atomic="true">
- <set>
- <parameter name='tmp.pidx' value='`$pidx`' />
- <parameter name='tmp.provided-ar.' value='`$mdsal-psd.provided-allotted-resources.provided-allotted-resource[$pidx].`' />
- <parameter name='tmp.found-in-ar' value='true' />
- <parameter name='tmp.ep-available' value='true' />
- </set>
- <break></break>
- </block>
- </outcome>
- </switch>
- </for>
- <switch test='`$tmp.found-in-ar`'>
- <outcome value='true'>
- <block atomic="true">
- <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='GENERIC-RESOURCE-API' key='connection-attachment-allotted-resources/connection-attachment-allotted-resource/$tmp.provided-ar.allotted-resource-id/' pfx='mdsal-other-ar' >
- <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 provided attachment resource not found" />
- </return>
- </outcome>
- </get-resource>
- </block>
- </outcome>
- </switch>
- </block>
- </outcome>
- <outcome value='1'>
- <block atomic="true">
- <switch test='`$mdsal-psd.networks.network_length`'>
- <outcome value='1'>
- <block atomic="true">
- <set>
- <parameter name='tmp.network.' value='`$mdsal-psd.networks.network[0].`' />
- </set>
- <for index='nidx' start='0' end='`$tmp.network.network-data.network-request-input.network-input-parameters.param_length`' >
- <block>
- <switch test="`$tmp.network.network-data.network-request-input.network-input-parameters.param[$nidx].name == 'access-node-id'`">
- <outcome value='true'>
- <set>
- <parameter name='tmp.found-in-network' value='true' />
- <parameter name='tmp.ep-available' value='true' />
- </set>
- </outcome>
- </switch>
- <switch test="`$tmp.network.network-data.network-request-input.network-input-parameters.param[$idx].name == 'name'`">
- <outcome value='true'>
- <set>
- <parameter name='prop.global.sotn.etht-svc-name' value='`$tmp.network.network-data.network-request-input.network-input-parameters.param[$idx].value`' />
- <parameter name='prop.global.sotn.bandwidth-profile-name' value='`$tmp.network.network-data.network-request-input.network-input-parameters.param[$idx].value`' />
- </set>
- </outcome>
- </switch>
- <switch test="`$tmp.network.network-data.network-request-input.network-input-parameters.param[$idx].name == 'description'`">
- <outcome value='true'>
- <set>
- <parameter name='prop.global.sotn.etht-svc-descr' value='`$tmp.network.network-data.network-request-input.network-input-parameters.param[$idx].value`' />
- </set>
- </outcome>
- </switch>
- <switch test="`$tmp.network.network-data.network-request-input.network-input-parameters.param[$idx].name == 'tenantId'`">
- <outcome value='true'>
- <set>
- <parameter name='prop.global.sotn.tenantId' value='`$tmp.network.network-data.network-request-input.network-input-parameters.param[$idx].value`' />
- </set>
- </outcome>
- </switch>
- <switch test="`$tmp.network.network-data.network-request-input.network-input-parameters.param[$idx].name == 'vpnType'`">
- <outcome value='true'>
- <set>
- <parameter name='prop.global.sotn.vpnType' value='`$tmp.network.network-data.network-request-input.network-input-parameters.param[$idx].value`' />
- </set>
- </outcome>
- </switch>
- <switch test="`$tmp.network.network-data.network-request-input.network-input-parameters.param[$idx].name == 'CIR'`">
- <outcome value='true'>
- <set>
- <parameter name='prop.sotn.cir' value='`$tmp.network.network-data.network-request-input.network-input-parameters.param[$idx].value`' />
- </set>
- </outcome>
- </switch>
- <switch test="`$tmp.network.network-data.network-request-input.network-input-parameters.param[$idx].name == 'EIR'`">
- <outcome value='true'>
- <set>
- <parameter name='prop.global.sotn.eir' value='`$tmp.network.network-data.network-request-input.network-input-parameters.param[$idx].value`' />
- </set>
- </outcome>
- </switch>
- <switch test="`$tmp.network.network-data.network-request-input.network-input-parameters.param[$idx].name == 'color-aware'`">
- <outcome value='true'>
- <set>
- <parameter name='prop.global.sotn.colorAware' value='`$tmp.network.network-data.network-request-input.network-input-parameters.param[$idx].value`' />
- </set>
- </outcome>
- </switch>
- <switch test="`$tmp.network.network-data.network-request-input.network-input-parameters.param[$idx].name == 'coupling-flag'`">
- <outcome value='true'>
- <set>
- <parameter name='prop.global.sotn.couplingFlag' value='`$tmp.network.network-data.network-request-input.network-input-parameters.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>
- </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: Incorrect state found more then 1 network" />
- </return>
- </outcome>
- </switch>
- </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>
- <switch test='`$tmp.ep-available`'>
- <outcome value='false'>
- <block></block>
- </outcome>
- <outcome value='true'>
- <block atomic="true">
- <switch test='`$tmp.found-in-ar`'>
- <outcome value='true'>
- <block atomic="true">
- <set>
- <parameter name='tmp.ep.parameters' value='`$mdsal-other-ar.allotted-resource-data.connection-attachment-topology.connection-attachment-parameters`' />
- </set>
- </block>
- </outcome>
- <outcome value='false'>
- <block atomic="true">
- <set>
- <parameter name='tmp.ep.parameters' value='`$tmp.network.network-data.network-request-input.network-input-parameters`' />
- </set>
- </block>
- </outcome>
- </switch>
- <for index='idx' start='0' end='`$tmp.ep.parameters.param_length`' >
- <block>
- <switch test="`$tmp.ep.parameters.param[$idx].name == 'access-node-id'`">
- <outcome value='true'>
- <set>
- <parameter name='prop.remote.connection-attachment.access-node-id' value='`$tmp.ep.parameters.param[$idx].value`' />
- </set>
- </outcome>
- </switch>
- <switch test="`$tmp.ep.parameters.param[$idx].name == 'access-ltp-id'`">
- <outcome value='true'>
- <set>
- <parameter name='prop.remote.connection-attachment.access-ltp-id' value='`$tmp.ep.parameters.param[$idx].value`' />
- </set>
- </outcome>
- </switch>
- <switch test="`$tmp.ep.parameters.param[$idx].name == 'clientSignal'`">
- <outcome value='true'>
- <set>
- <parameter name='prop.remote.connection-attachment.clientSignal' value='`$tmp.ep.parameters.param[$idx].value`' />
- </set>
- </outcome>
- </switch>
- <switch test="`$tmp.ep.parameters.param[$idx].name == 'cVLAN'`">
- <outcome value='true'>
- <set>
- <parameter name='prop.remote.connection-attachment.cVLAN' value='`$tmp.ep.parameters.param[$idx].value`' />
- </set>
- </outcome>
- </switch>
- <switch test="`$tmp.ep.parameters.param[$idx].name == 'access-provider-id'`">
- <outcome value='true'>
- <set>
- <parameter name='prop.remote.connection-attachment.access-provider-id' value='`$tmp.ep.parameters.param[$idx].value`' />
- </set>
- </outcome>
- </switch>
- <switch test="`$tmp.ep.parameters.param[$idx].name == 'access-client-id'`">
- <outcome value='true'>
- <set>
- <parameter name='prop.remote.connection-attachment.access-client-id' value='`$tmp.ep.parameters.param[$idx].value`' />
- </set>
- </outcome>
- </switch>
- <switch test="`$tmp.ep.parameters.param[$idx].name == 'access-topology-id'`">
- <outcome value='true'>
- <set>
- <parameter name='prop.remote.connection-attachment.access-topology-id' value='`$tmp.ep.parameters.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 atomic="true">
- <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/' + $prop.restapi.oof-getpath.templatefile`" />
- <parameter name="restapiUrl" value="`$prop.restapi.connection-oof-url'`" />
- <parameter name="restapiUser" value="`$prop.oof.user`" />
- <parameter name="restapiPassword" value="`$prop.oof.password`" />
- <parameter name="format" value="json"/>
- <parameter name="httpMethod" value="post"/>
- <parameter name="responsePrefix" value="oof"/>
- <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>
- <for index='vidx' start='0' end='`$oof.vpns_length`' >
- <block atomic="true">
- <set>
- <parameter name='oof.vpn.' value='`$oof.vpns[$vidx].`' />
- </set>
- <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="pnf"
- key="pnf.pnf-name = $oof.vpn.access-node-id AND
- depth = '0'"
- pfx='tmp.aai.pnf' local-only='false' >
- <outcome value='success'>
- <set>
- <parameter name='tmp.thirdparty-sdnc-id' value="`$tmp.aai.pnf.relationship-list.relationship[0].relationship-data[0].relationship-value`" />
- </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 pnf from AnAI with pnf-name = ' + $prop.connection-attachement.access-node-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 pnf from AnAI with pnf-name = ' + $prop.connection-attachement.access-node-id`" />
- </return>
- </outcome>
- </get-resource>
- <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="esr-thirdparty-sdnc"
- key="esr-thirdparty-sdnc.thirdparty-sdnc-id = $tmp.thirdparty-sdnc-id 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 + '/sotn-ethernet-service.json'`" />
- <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + 'restconf/data/ietf-eth-tran-service:etht-svc'`" />
- <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="patch"/>
- <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='tmp.vpnName' value='`$oof.vpn.access-node-id + '-' + $prop.global.sotn.etht-svc-name`' />
- </set>
- <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='vpn-binding'
- key='vpn-binding.vpn-id = $tmp.vpnName' >
- <parameter name='vpn-id' value='`$tmp.vpnName`' />
- <parameter name='vpn-name' value='`$tmp.vpnName`' />
- <parameter name='access-provider-id' value='`$oof.vpn.access-provider-id`' />
- <parameter name='access-client-id' value='`$oof.vpn.access-client-id`' />
- <parameter name='access-topology-id' value='`$oof.vpn.access-topology-id`' />
- <parameter name='src-access-node-id' value='`$oof.vpn.access-node-id`' />
- <parameter name='src-access-ltp-id' value='`$oof.vpn.src-access-ltp-id`' />
- <parameter name='dst-access-node-id' value='`$oof.vpn.access-node-id`' />
- <parameter name='dst-access-ltp-id' value='`$oof.vpn.dst-access-ltp-id`' />
- <parameter name='cvlan-tag-entry' value='`$prop.connection-attachment.cVLAN`' />
- <parameter name='operational-status' value='Created' />
- <parameter name='model-customization-id' value='`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`' />
- <parameter name='model-invariant-id' value='`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`' />
- <parameter name='model-version-id' value='`$network-topology-operation-input.network-information.onap-model-information.model-uuid`' />
- <parameter name='configuration-selflink' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $network-topology-operation-input.service-information.service-instance-id + '/service-data/networks/network/' + $prop.sotn.network-id + '/network-data/'` " />
- </save>
- <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='vpn-binding:relationship-list'
- key='vpn-binding.vpn-id = $tmp.vpnName
- force="true" pfx="tmp.AnAI-data">
- <parameter name="relationship-list.relationship[0].related-to" value="connectivity" />
- <parameter name="relationship-list.relationship[0].related-link" value="`'/network/connectivities/connectivity/' + $mdsal-psd.networks.network[0].network-id`" />
- <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="connectivity.connectivity-id" />
- <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$mdsal-psd.networks.network[0].network-id`" />
- </save>
- <set>
- <parameter name='src-ltpId' value="`'nodeId-' + $oof.vpn.access-node-id + '-ltpId-' + $oof.vpn.src-access-ltp-id`" />
- <parameter name='dst-ltpId' value="`'nodeId-' + $oof.vpn.access-node-id + '-ltpId-' + $oof.vpn.dst-access-ltp-id`" />
- </set>
- <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='vpn-binding:relationship-list'
- key='vpn-binding.vpn-id = $tmp.vpnName
- force="true" pfx="tmp.AnAI-data">
- <parameter name="relationship-list.relationship[0].related-to" value="p-interface" />
- <parameter name="relationship-list.relationship[0].related-link" value="`'/network/pnfs/pnf/p-interfaces/p-interface/' + $src-ltpId`" />
- <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="p-interface.interface-name" />
- <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$src-ltpId`" />
- </save>
- <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='vpn-binding:relationship-list'
- key='vpn-binding.vpn-id = $tmp.vpnName
- force="true" pfx="tmp.AnAI-data">
- <parameter name="relationship-list.relationship[0].related-to" value="p-interface" />
- <parameter name="relationship-list.relationship[0].related-link" value="`'/network/pnfs/pnf/p-interfaces/p-interface/' + $dst-ltpId`" />
- <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="p-interface.interface-name" />
- <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$dst-ltpId`" />
- </save>
- </block>
- </for>
- </block>
- </block>
- </outcome>
- </switch>
- <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.` " />
- <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$connection-attachment-topology-operation-input.allotted-resource-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.sotn-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>
+<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='sotn-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='sotn-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='tmp.found-in-ar' value='false' /> + <parameter name='tmp.found-in-network' value='false' /> + <parameter name='tmp.ep-available' value='false' /> + </set> + <switch test='`$mdsal-psd.service-data.provided-allotted-resources.provided-allotted-resource_length`'> + <outcome value='2'> + <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></block> + </outcome> + <outcome value='false'> + <block atomic="true"> + <set> + <parameter name='tmp.pidx' value='`$pidx`' /> + <parameter name='tmp.provided-ar.' value='`$mdsal-psd.service-data.provided-allotted-resources.provided-allotted-resource[$pidx].`' /> + <parameter name='tmp.found-in-ar' value='true' /> + <parameter name='tmp.ep-available' value='true' /> + </set> + </block> + </outcome> + </switch> + </for> + <switch test='`$tmp.found-in-ar`'> + <outcome value='true'> + <block atomic="true"> + <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-other-url-connection"/> + <parameter name="target" value="{allotted-resource-id}"/> + <parameter name="replacement" value="`$tmp.provided-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-other-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-other-ar" /> + <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 provided attachment resource not found" /> + </return> + </outcome> + </execute> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value='1'> + <block atomic="true"> + <switch test='`$mdsal-psd.service-data.networks.network_length`'> + <outcome value='1'> + <block atomic="true"> + <set> + <parameter name='tmp.network.' value='`$mdsal-psd.service-data.networks.network[0].`' /> + </set> + <for index='nidx' start='0' end='`$tmp.network.network-data.network-request-input.network-input-parameters.param_length`' > + <block> + <switch test="`$tmp.network.network-data.network-request-input.network-input-parameters.param[$nidx].name == 'access-node-id'`"> + <outcome value='true'> + <set> + <parameter name='tmp.found-in-network' value='true' /> + <parameter name='tmp.ep-available' value='true' /> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-request-input.network-input-parameters.param[$nidx].name == 'name'`"> + <outcome value='true'> + <set> + <parameter name='prop.global.sotn.etht-svc-name' value='`$tmp.network.network-data.network-request-input.network-input-parameters.param[$nidx].value`' /> + <parameter name='prop.global.sotn.bandwidth-profile-name' value='`$tmp.network.network-data.network-request-input.network-input-parameters.param[$nidx].value`' /> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-request-input.network-input-parameters.param[$nidx].name == 'description'`"> + <outcome value='true'> + <set> + <parameter name='prop.global.sotn.etht-svc-descr' value='`$tmp.network.network-data.network-request-input.network-input-parameters.param[$nidx].value`' /> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-request-input.network-input-parameters.param[$nidx].name == 'tenantId'`"> + <outcome value='true'> + <set> + <parameter name='prop.global.sotn.tenantId' value='`$tmp.network.network-data.network-request-input.network-input-parameters.param[$nidx].value`' /> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-request-input.network-input-parameters.param[$nidx].name == 'vpnType'`"> + <outcome value='true'> + <set> + <parameter name='prop.global.sotn.vpnType' value='`$tmp.network.network-data.network-request-input.network-input-parameters.param[$nidx].value`' /> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-request-input.network-input-parameters.param[$nidx].name == 'cir'`"> + <outcome value='true'> + <set> + <parameter name='prop.sotn.cir' value='`$tmp.network.network-data.network-request-input.network-input-parameters.param[$nidx].value`' /> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-request-input.network-input-parameters.param[$nidx].name == 'eir'`"> + <outcome value='true'> + <set> + <parameter name='prop.global.sotn.eir' value='`$tmp.network.network-data.network-request-input.network-input-parameters.param[$nidx].value`' /> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-request-input.network-input-parameters.param[$nidx].name == 'colorAware'`"> + <outcome value='true'> + <set> + <parameter name='prop.global.sotn.colorAware' value='`$tmp.network.network-data.network-request-input.network-input-parameters.param[$nidx].value`' /> + </set> + </outcome> + </switch> + <switch test="`$tmp.network.network-data.network-request-input.network-input-parameters.param[$nidx].name == 'couplingFlag'`"> + <outcome value='true'> + <set> + <parameter name='prop.global.sotn.couplingFlag' value='`$tmp.network.network-data.network-request-input.network-input-parameters.param[$nidx].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> + </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: Incorrect state found more then 1 network" /> + </return> + </outcome> + </switch> + </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: End points not available" /> + </return> + </outcome> + </switch> + <switch test='`$tmp.ep-available`'> + <outcome value='false'> + <block></block> + </outcome> + <outcome value='true'> + <block atomic="true"> + <switch test='`$tmp.found-in-ar`'> + <outcome value='true'> + <block atomic="true"> + <set> + <parameter name='tmp.ep.parameters.' value='`$mdsal-other-ar.connection-attachment-allotted-resource[0].allotted-resource-data.allotted-resource-operation-information.connection-attachment-request-input.`' /> + </set> + </block> + </outcome> + <outcome value='false'> + <block atomic="true"> + <set> + <parameter name='tmp.ep.parameters.' value='`$tmp.network.network-data.network-request-input.network-input-parameters.`' /> + </set> + </block> + </outcome> + </switch> + <for index='idx' start='0' end='`$tmp.ep.parameters.param_length`'> + <block> + <switch test="`$tmp.ep.parameters.param[$idx].name == 'access-node-id'`"> + <outcome value='true'> + <set> + <parameter name='prop.remote.connection-attachment.access-node-id' value='`$tmp.ep.parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + <switch test="`$tmp.ep.parameters.param[$idx].name == 'access-ltp-id'`"> + <outcome value='true'> + <set> + <parameter name='prop.remote.connection-attachment.access-ltp-id' value='`$tmp.ep.parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + <switch test="`$tmp.ep.parameters.param[$idx].name == 'clientSignal'`"> + <outcome value='true'> + <set> + <parameter name='prop.remote.connection-attachment.clientSignal' value='`$tmp.ep.parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + <switch test="`$tmp.ep.parameters.param[$idx].name == 'cVLAN'`"> + <outcome value='true'> + <set> + <parameter name='prop.remote.connection-attachment.cVLAN' value='`$tmp.ep.parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + <switch test="`$tmp.ep.parameters.param[$idx].name == 'access-provider-id'`"> + <outcome value='true'> + <set> + <parameter name='prop.remote.connection-attachment.access-provider-id' value='`$tmp.ep.parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + <switch test="`$tmp.ep.parameters.param[$idx].name == 'access-client-id'`"> + <outcome value='true'> + <set> + <parameter name='prop.remote.connection-attachment.access-client-id' value='`$tmp.ep.parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + <switch test="`$tmp.ep.parameters.param[$idx].name == 'access-topology-id'`"> + <outcome value='true'> + <set> + <parameter name='prop.remote.connection-attachment.access-topology-id' value='`$tmp.ep.parameters.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 atomic="true"> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/' + $prop.restapi.oof-getpath.templatefile`" /> + <parameter name="restapiUrl" value="`$prop.restapi.connection-oof-url`" /> + <parameter name="restapiUser" value="`$prop.oof.user`" /> + <parameter name="restapiPassword" value="`$prop.oof.password`" /> + <parameter name="format" value="json"/> + <parameter name="httpMethod" value="post"/> + <parameter name="responsePrefix" value="oof"/> + <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 OOF api" /> + </return> + </outcome> + <outcome value='success'> + <block></block> + </outcome> + </execute> + <for index='vidx' start='0' end='`$oof.vpns_length`' > + <block atomic="true"> + <set> + <parameter name='oof.vpn.' value='`$oof.vpns[$vidx].`' /> + </set> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="pnf" + key="network-resource.network-id = $mdsal-psd.service-data.networks.network[0].network-id + AND pnf.pnf-name = $oof.vpn.access-node-id + AND depth = '0'" + pfx='tmp.aai.pnf' local-only='false' > + <outcome value='success'> + <set> + <parameter name='tmp.thirdparty-sdnc-id' value="`$tmp.aai.pnf.relationship-list.relationship[0].relationship-data[0].relationship-value`" /> + </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 pnf from AnAI with pnf-name = ' + $prop.connection-attachement.access-node-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 pnf from AnAI with pnf-name = ' + $prop.connection-attachement.access-node-id`" /> + </return> + </outcome> + </get-resource> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="esr-thirdparty-sdnc" + key="esr-thirdparty-sdnc.thirdparty-sdnc-id = $tmp.thirdparty-sdnc-id 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 + '/sotn-ethernet-service.json'`" /> + <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + 'restconf/data/ietf-eth-tran-service:etht-svc'`" /> + <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="patch"/> + <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='tmp.vpnName' value="`$oof.vpn.access-node-id + '-' + $prop.global.sotn.etht-svc-name`" /> + </set> + <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='vpn-binding' + key='vpn-binding.vpn-id = $tmp.vpnName' > + <parameter name='vpn-id' value='`$tmp.vpnName`' /> + <parameter name='vpn-name' value='`$tmp.vpnName`' /> + <parameter name='access-provider-id' value='`$oof.vpn.access-provider-id`' /> + <parameter name='access-client-id' value='`$oof.vpn.access-client-id`' /> + <parameter name='access-topology-id' value='`$oof.vpn.access-topology-id`' /> + <parameter name='src-access-node-id' value='`$oof.vpn.access-node-id`' /> + <parameter name='src-access-ltp-id' value='`$oof.vpn.src-access-ltp-id`' /> + <parameter name='dst-access-node-id' value='`$oof.vpn.access-node-id`' /> + <parameter name='dst-access-ltp-id' value='`$oof.vpn.dst-access-ltp-id`' /> + <parameter name='vpn-type' value='`$prop.global.sotn.vpnType`' /> + <parameter name='operational-status' value='Created' /> + <parameter name='model-customization-id' value='`$network-topology-operation-input.network-information.onap-model-information.model-customization-uuid`' /> + <parameter name='model-invariant-id' value='`$network-topology-operation-input.network-information.onap-model-information.model-invariant-uuid`' /> + <parameter name='model-version-id' value='`$network-topology-operation-input.network-information.onap-model-information.model-uuid`' /> + </save> + <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='vpn-binding:relationship-list' + key='vpn-binding.vpn-id = $tmp.vpnName' + force="true" pfx="tmp.AnAI-data"> + <parameter name="relationship-list.relationship[0].related-to" value="connectivity" /> + <parameter name="relationship-list.relationship[0].related-link" value="`'/network/connectivities/connectivity/' + $mdsal-psd.service-data.networks.network[0].network-id`" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="connectivity.connectivity-id" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$mdsal-psd.service-data.networks.network[0].network-id`" /> + </save> + <set> + <parameter name='src-ltpId' value="`'nodeId-' + $oof.vpn.access-node-id + '-ltpId-' + $oof.vpn.src-access-ltp-id`" /> + <parameter name='dst-ltpId' value="`'nodeId-' + $oof.vpn.access-node-id + '-ltpId-' + $oof.vpn.dst-access-ltp-id`" /> + </set> + <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='vpn-binding:relationship-list' + key='vpn-binding.vpn-id = $tmp.vpnName' + force="true" pfx="tmp.AnAI-data"> + <parameter name="relationship-list.relationship[0].related-to" value="p-interface" /> + <parameter name="relationship-list.relationship[0].related-link" value="`'/network/network-resources/network-resource/' + $mdsal-psd.service-data.networks.network[0].network-id + '/pnfs/pnf/' + $oof.vpn.access-node-id '/p-interfaces/p-interface/' + $src-ltpId`" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="p-interface.interface-name" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$src-ltpId`" /> + </save> + <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='vpn-binding:relationship-list' + key='vpn-binding.vpn-id = $tmp.vpnName' + force="true" pfx="tmp.AnAI-data"> + <parameter name="relationship-list.relationship[0].related-to" value="p-interface" /> + <parameter name="relationship-list.relationship[0].related-link" value="`'/network/network-resources/network-resource/' + $mdsal-psd.service-data.networks.network[0].network-id + '/pnfs/pnf/' + $oof.vpn.access-node-id '/p-interfaces/p-interface/' + $dst-ltpId`" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="p-interface.interface-name" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$dst-ltpId`" /> + </save> + </block> + </for> + </block> + </block> + </outcome> + </switch> + <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.` " /> + <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$connection-attachment-topology-operation-input.allotted-resource-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.sotn-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>
\ No newline at end of file diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sotn-attachment-topology-operation-create.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sotn-attachment-topology-operation-create.xml index 727246a3..5ecae563 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sotn-attachment-topology-operation-create.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sotn-attachment-topology-operation-create.xml @@ -1,256 +1,267 @@ -<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='sotn-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="SOTNAttachmentInstance" />
- </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>
- <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='GENERIC-RESOURCE-API' key='connection-attachment-allotted-resources/connection-attachment-allotted-resource/$tmp.ar.allotted-resource-id/' pfx='mdsal-ar' >
- <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>
- </get-resource>
- <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>
- <call module='GENERIC-RESOURCE-API' rpc='connection-attachment-get-request-input-param' mode='sync' ></call>
- <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
- <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sotn-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="name" value="`$prop.connection-attachment.sotnVpnName`" />
- <parameter name="access-provider-id" value="`$prop.connection-attachment.access-provider-id`" />
- <parameter name="access-client-id" value="`$prop.connection-attachment.access-client-id`" />
- <parameter name="access-topology-id" value="`$prop.connection-attachment.access-topology-id`" />
- <parameter name="access-node-id" value="`$prop.connection-attachment.access-node-id`" />
- <parameter name="access-ltp-id" value="`$prop.connection-attachment.access-ltp-id`" />
- <parameter name="cvlan-tag-entry" value="`$prop.connection-attachment.cVLAN`" />
- <parameter name="selflink" value="`$tmp.ar.self-link`" />
- <parameter name="model-invariant-id" value="`$connection-attachment-topology-operation-input.allotted-resource-information.onap-model-information.model-invariant-uuid`" />
- <parameter name="model-version-id" value="`$connection-attachment-topology-operation-input.allotted-resource-information.onap-model-information.model-uuid`" />
- <parameter name="operational-status" value="Created" />
- <outcome value='failure'>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="AAI failed" />
- </return>
- </outcome>
- <outcome value='not-found'>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="AAI failed" />
- </return>
- </outcome>
- </update>
- <return status='success'>
- <parameter name="ack-final-indicator" value="Y" />
- <parameter name="error-code" value="200" />
- <parameter name="error-message" value="`$error-message`" />
- </return>
- </block>
- </method>
-</service-logic>
+<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='sotn-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="SOTNAttachmentInstance" /> + </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> + <call module='GENERIC-RESOURCE-API' rpc='sotn-get-saved-ar-param' mode='sync' ></call> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.sotn-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="id" value="`$tmp.ar.allotted-resource-id`" /> + <parameter name="name" value="`$prop.connection-attachment.sotnVpnName`" /> + <parameter name="access-provider-id" value="`$prop.connection-attachment.access-provider-id`" /> + <parameter name="access-client-id" value="`$prop.connection-attachment.access-client-id`" /> + <parameter name="access-topology-id" value="`$prop.connection-attachment.access-topology-id`" /> + <parameter name="access-node-id" value="`$prop.connection-attachment.access-node-id`" /> + <parameter name="access-ltp-id" value="`$prop.connection-attachment.access-ltp-id`" /> + <parameter name="cvlan" value="`$prop.connection-attachment.cVLAN`" /> + <parameter name="vpn-name" value="`$prop.connection-attachment.sotnVpnName`" /> + <parameter name="selflink" value="`$tmp.ar.self-link`" /> + <parameter name="model-invariant-id" value="`$connection-attachment-topology-operation-input.allotted-resource-information.onap-model-information.model-invariant-uuid`" /> + <parameter name="model-version-id" value="`$connection-attachment-topology-operation-input.allotted-resource-information.onap-model-information.model-uuid`" /> + <parameter name="operational-status" value="Created" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </outcome> + </update> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sotn-attachment-topology-operation-deactivate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sotn-attachment-topology-operation-deactivate.xml index e11ef2fb..4a6baad7 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sotn-attachment-topology-operation-deactivate.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sotn-attachment-topology-operation-deactivate.xml @@ -1,371 +1,400 @@ -<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='sotn-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>
- <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='GENERIC-RESOURCE-API' key='connection-attachment-allotted-resources/connection-attachment-allotted-resource/$connection-attachment-topology-operation-input.allotted-resource-information.allotted-resource-id/' pfx='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>
- </get-resource>
- <block atomic="true">
- <call module='GENERIC-RESOURCE-API' rpc='connection-attachment-get-request-input-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>
- <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='GENERIC-RESOURCE-API' key='services/service/$tmp.ar.parent-service-instance-id/service-data' pfx='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>
- </get-resource>
- <set>
- <parameter name='tmp.found-in-ar' value='false' />
- <parameter name='tmp.found-in-network' value='false' />
- <parameter name='tmp.ep-available' value='false' />
- </set>
- <switch test='`$mdsal-psd.provided-allotted-resources.provided-allotted-resource_length`'>
- <outcome value='2'>
- <block atomic="true">
- <for index='pidx' start='0' end='`$mdsal-psd.provided-allotted-resources.provided-allotted-resource_length`' >
- <switch test="`$mdsal-psd.provided-allotted-resources.provided-allotted-resource[$cidx].allotted-resource-id == $tmp.ar.allotted-resource-id`">
- <outcome value='true'>
- <block></block>
- </outcome>
- <outcome value='false'>
- <block atomic="true">
- <set>
- <parameter name='tmp.pidx' value='`$pidx`' />
- <parameter name='tmp.provided-ar.' value='`$mdsal-psd.provided-allotted-resources.provided-allotted-resource[$pidx].`' />
- <parameter name='tmp.found-in-ar' value='true' />
- <parameter name='tmp.ep-available' value='true' />
- </set>
- <break></break>
- </block>
- </outcome>
- </switch>
- </for>
- </block>
- </outcome>
- <outcome value='1'>
- <block atomic="true">
- <switch test='`$mdsal-psd.networks.network_length`'>
- <outcome value='1'>
- <block atomic="true">
- <set>
- <parameter name='tmp.network.' value='`$mdsal-psd.networks.network[0].`' />
- </set>
- <for index='nidx' start='0' end='`$tmp.network.network-data.network-request-input.network-input-parameters.param_length`' >
- <block>
- <switch test="`$tmp.network.network-data.network-request-input.network-input-parameters.param[$nidx].name == 'access-node-id'`">
- <outcome value='true'>
- <set>
- <parameter name='tmp.found-in-network' value='true' />
- <parameter name='tmp.ep-available' value='true' />
- </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>
- </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: Incorrect state found more then 1 network" />
- </return>
- </outcome>
- </switch>
- </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>
- <switch test='`$tmp.ep-available`'>
- <outcome value='false'>
- <block></block>
- </outcome>
- <outcome value='true'>
- <block atomic="true">
- <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="connectivity"
- key="connectivity.connectivity-id = $mdsal-psd.networks.network[0].network-id AND
- depth = '1'"
- pfx='tmp.connectivity' local-only='false' >
- <for silentFailure='true' index='vidx' start='0' end='`$tmp.connectivity.relationship-list.relationship_length`' >
- <switch test='`$tmp.connectivity.relationship-list.relationship[$vidx].related-to`'>
- <outcome value='vpn-binding'>
- <block atomic="true">
- <set>
- <parameter name='tmp.vpn-name' value="`$tmp.connectivity.relationship-list.relationship[$vidx].relationship-data[0].relationship-value` " />
- </set>
- <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
- <parameter name="original_string" value='`$tmp.vpn-name`'/>
- <parameter name="regex" value="-"/>
- <parameter name="ctx_memory_result_key" value="route1"/>
- <outcome value='success'>
- <set>
- <parameter name='tmp.node-id' value='`$route1[0]`' />
- </set>
- </outcome>
- <outcome value='failure'>
- <return status='failure'>
- <parameter name='error-code' value='' />
- <parameter name='error-message' value="An error occured while splitting sna1_route" />
- </return>
- </outcome>
- </execute>
- <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="pnf"
- key="pnf.pnf-name = $tmp.node-id AND
- depth = '0'"
- pfx='tmp.aai.pnf' local-only='false' >
- <outcome value='success'>
- <set>
- <parameter name='tmp.thirdparty-sdnc-id' value="`$tmp.aai.pnf.relationship-list.relationship[0].relationship-data[0].relationship-value`" />
- </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 pnf from AnAI with pnf-name = ' + $prop.connection-attachement.access-node-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 pnf from AnAI with pnf-name = ' + $prop.connection-attachement.access-node-id`" />
- </return>
- </outcome>
- </get-resource>
- <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
- resource="esr-thirdparty-sdnc"
- key="esr-thirdparty-sdnc.thirdparty-sdnc-id = $tmp.thirdparty-sdnc-id 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="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + 'restconf/data/ietf-eth-tran-service:etht-svc/etht-svc-instances=' + $tmp.vpn-name`" />
- <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
- <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
- <parameter name="format" value="json"/>
- <parameter name="httpMethod" value="delete"/>
- <parameter name="responsePrefix" value="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>
- </block>
- </outcome>
- </switch>
- </for>
- </get-resource>
- </block>
- </outcome>
- </switch>
- <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.` " />
- <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$connection-attachment-topology-operation-input.allotted-resource-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.sotn-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="PendingDelete" />
- <outcome value='failure'>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="AAI failed" />
- </return>
- </outcome>
- <outcome value='not-found'>
- <return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="AAI failed" />
- </return>
- </outcome>
- </update>
- <return status='success'>
- <parameter name="ack-final-indicator" value="Y" />
- <parameter name="error-code" value="200" />
- <parameter name="error-message" value="`$error-message`" />
- </return>
- </block>
- </method>
-</service-logic>
+<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='sotn-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='sotn-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='tmp.found-in-ar' value='false' /> + <parameter name='tmp.found-in-network' value='false' /> + <parameter name='tmp.ep-available' value='false' /> + </set> + <switch test='`$mdsal-psd.service-data.provided-allotted-resources.provided-allotted-resource_length`'> + <outcome value='2'> + <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></block> + </outcome> + <outcome value='false'> + <block atomic="true"> + <set> + <parameter name='tmp.pidx' value='`$pidx`' /> + <parameter name='tmp.provided-ar.' value='`$mdsal-psd.service-data.provided-allotted-resources.provided-allotted-resource[$pidx].`' /> + <parameter name='tmp.found-in-ar' value='true' /> + <parameter name='tmp.ep-available' value='true' /> + </set> + </block> + </outcome> + </switch> + </for> + </block> + </outcome> + <outcome value='1'> + <block atomic="true"> + <switch test='`$mdsal-psd.service-data.networks.network_length`'> + <outcome value='1'> + <block atomic="true"> + <set> + <parameter name='tmp.network.' value='`$mdsal-psd.service-data.networks.network[0].`' /> + </set> + <for index='nidx' start='0' end='`$tmp.network.network-data.network-request-input.network-input-parameters.param_length`' > + <block> + <switch test="`$tmp.network.network-data.network-request-input.network-input-parameters.param[$nidx].name == 'access-node-id'`"> + <outcome value='true'> + <set> + <parameter name='tmp.found-in-network' value='true' /> + <parameter name='tmp.ep-available' value='true' /> + </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> + </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: Incorrect state found more then 1 network" /> + </return> + </outcome> + </switch> + </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> + <switch test='`$tmp.ep-available`'> + <outcome value='false'> + <block></block> + </outcome> + <outcome value='true'> + <block atomic="true"> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="connectivity" + key="connectivity.connectivity-id = $mdsal-psd.networks.network[0].network-id AND + depth = '1'" + pfx='tmp.connectivity' local-only='false' > + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="Error: Connectivity resource not found" /> + </return> + </outcome> + <outcome value='success'> + <block> + <for silentFailure='true' index='vidx' start='0' end='`$tmp.connectivity.relationship-list.relationship_length`' > + <switch test='`$tmp.connectivity.relationship-list.relationship[$vidx].related-to`'> + <outcome value='vpn-binding'> + <block atomic="true"> + <set> + <parameter name='tmp.vpn-name' value="`$tmp.connectivity.relationship-list.relationship[$vidx].relationship-data[0].relationship-value` " /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' > + <parameter name="original_string" value='`$tmp.vpn-name`'/> + <parameter name="regex" value="-"/> + <parameter name="ctx_memory_result_key" value="route1"/> + <outcome value='success'> + <set> + <parameter name='tmp.node-id' value='`$route1[0]`' /> + </set> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='error-code' value='' /> + <parameter name='error-message' value="An error occured while splitting sna1_route" /> + </return> + </outcome> + </execute> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="pnf" + key="network-resource.network-id = $mdsal-psd.service-data.networks.network[0].network-id + AND pnf.pnf-name = $tmp.node-id + AND depth = '0'" + pfx='tmp.aai.pnf' local-only='false' > + <outcome value='success'> + <set> + <parameter name='tmp.thirdparty-sdnc-id' value="`$tmp.aai.pnf.relationship-list.relationship[0].relationship-data[0].relationship-value`" /> + </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 pnf from AnAI with pnf-name = ' + $prop.connection-attachement.access-node-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 pnf from AnAI with pnf-name = ' + $prop.connection-attachement.access-node-id`" /> + </return> + </outcome> + </get-resource> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="esr-thirdparty-sdnc" + key="esr-thirdparty-sdnc.thirdparty-sdnc-id = $tmp.thirdparty-sdnc-id 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="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + 'restconf/data/ietf-eth-tran-service:etht-svc/etht-svc-instances=' + $tmp.vpn-name`" /> + <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" /> + <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" /> + <parameter name="format" value="json"/> + <parameter name="httpMethod" value="delete"/> + <parameter name="responsePrefix" value="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> + </block> + </outcome> + </switch> + </for> + </block> + </outcome> + </get-resource> + </block> + </outcome> + </switch> + <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.` " /> + <parameter name='connection-attachment-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$connection-attachment-topology-operation-input.allotted-resource-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.sotn-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="PendingDelete" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </outcome> + <outcome value='not-found'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="AAI failed" /> + </return> + </outcome> + </update> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sotn-attachment-topology-operation-delete.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sotn-attachment-topology-operation-delete.xml index 1dd02a90..f2ac12f1 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sotn-attachment-topology-operation-delete.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_sotn-attachment-topology-operation-delete.xml @@ -1,175 +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='sotn-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>
- <break></break>
- </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>
- <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='GENERIC-RESOURCE-API' key='services/service/$tmp.ar.parent-service-instance-id/service-data' pfx='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>
- </get-resource>
- <switch test='`$mdsal-psd.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.provided-allotted-resources.provided-allotted-resource_length`' >
- <switch test="`$mdsal-psd.provided-allotted-resources.provided-allotted-resource[$cidx].allotted-resource-id == $tmp.ar.allotted-resource-id`">
- <outcome value='true'>
- <block atomic="true">
- <set>
- <parameter name='tmp.pidx' value='`$pidx`' />
- </set>
- <break></break>
- </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 + 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='sotn-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>
\ No newline at end of file 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 98762e99..3359ece8 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,236 @@ -<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.service-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='`$sotn-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='`$sotn-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 + 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 |