diff options
author | Rahul_cool <rahul.tamrkar@huawei.com> | 2020-03-30 12:10:01 +0530 |
---|---|---|
committer | Rahul_cool <rahul.tamrkar@huawei.com> | 2020-03-30 12:23:22 +0530 |
commit | d456643032f4748e60f19f1bab6b58184595f4ad (patch) | |
tree | f2cc32acaededa0274ba94ebfa82e5cd09aefb7e /platform-logic/generic-resource-api/src/main/xml | |
parent | 8786aff1f95d4d170a78636c11a6465e77fe4aab (diff) |
Moved bbs logic from network-topoly-operation to vnf
Issue-ID: SDNC-1021
Signed-off-by: Rahul_cool <rahul.tamrkar@huawei.com>
Change-Id: I720bd21ab355d4d3cad3448d814d9ae5a4da82f3
Former-commit-id: a5e6280beda10b6cc031229dfbe59fcda2ead6f9
Diffstat (limited to 'platform-logic/generic-resource-api/src/main/xml')
8 files changed, 989 insertions, 0 deletions
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_bbs-access-connectivity-vnf-topology-operation-create-huawei.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_bbs-access-connectivity-vnf-topology-operation-create-huawei.xml new file mode 100644 index 00000000..3f30d506 --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_bbs-access-connectivity-vnf-topology-operation-create-huawei.xml @@ -0,0 +1,276 @@ +<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='bbs-access-connectivity-vnf-topology-operation-create-huawei' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-bbs-vnf-input-parameters' mode='sync' ></call>
+ <set>
+ <parameter name='vnf-input-parameters.' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.`' />
+ <parameter name='prop.sdncRestApi.thirdpartySdnc.url' value='https://172.30.0.55:26335' />
+ <parameter name='prop.bbs.HsiPackage' value='50M' />
+ <parameter name='prop.bbs.HsiType' value='IPoE' />
+ </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>
+ <for index='idx' start='0' end='`$vnf-input-parameters.param_length`' >
+ <block>
+ <switch test="`$vnf-input-parameters.param[$idx].name == 'remote_id'`">
+ <outcome value='true'>
+ <switch test='`$vnf-input-parameters.param[$idx].value`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$vnf-input-parameters.param[$idx].name +' value is null, please check it.'`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.bbs.remote_id' value='`$vnf-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test="`$vnf-input-parameters.param[$idx].name == 'ONTSN'`">
+ <outcome value='true'>
+ <switch test='`$vnf-input-parameters.param[$idx].value`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$vnf-input-parameters.param[$idx].name +' value is null, please check it.'`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.bbs.ONTSN' value='`$vnf-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test="`$vnf-input-parameters.param[$idx].name == 'CVLAN'`">
+ <outcome value='true'>
+ <switch test='`$vnf-input-parameters.param[$idx].value`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$vnf-input-parameters.param[$idx].name +' value is null, please check it.'`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.bbs.CVLAN' value='`$vnf-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test="`$vnf-input-parameters.param[$idx].name == 'SVLAN'`">
+ <outcome value='true'>
+ <switch test='`$vnf-input-parameters.param[$idx].value`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$vnf-input-parameters.param[$idx].name +' value is null, please check it.'`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.bbs.SVLAN' value='`$vnf-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-token-template.json'`"/>
+ <parameter name="restapiUrl" value="`'http://159.138.58.209:30335/rest/plat/smapp/v1/oauth/token'`"/>
+ <parameter name="format" value="json"/>
+ <parameter name="httpMethod" value="put"/>
+ <parameter name="responsePrefix" value="token-result"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.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="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url+'/rest/plat/smapp/v1/oauth/token'`"/>-->
+ <outcome value='success'>
+ <switch test='`$token-result.accessSession`'>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.sdncRestApi.token_id' value='`$token-result.accessSession`' />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing queryTokenID,vaule is null" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error failed to call queryTokenID" />
+ </return>
+ </outcome>
+ </execute>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-access-connectivity-create.json'`" />
+ <parameter name="restapiUrl" value="`'http://159.138.58.209:30335/ws/rest/1002/FanOpenAPI/ActiveOnt'`" />
+ <parameter name="contentType" value="application/json"/>
+ <parameter name="httpMethod" value="post"/>
+ <parameter name="responsePrefix" value="service-result"/>
+ <parameter name="customHttpHeaders" value="`'X-Auth-Token=' + $prop.sdncRestApi.token_id`"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.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="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/ws/rest/1002/FanOpenAPI/ActiveOnt'`" />-->
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error failed to call createAccessConnectivityService" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <switch test="`$service-result.errors.error[0].error-message`">
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error createAccessConnectivityService return: '+$service-result.errors.error[0].error-message`" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <block>
+ <set>
+ <parameter name='prop.bbs.serviceID' value="`$service-result.accessE2Eservice.serviceID`"/>
+ </set>
+ </block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ <block>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID">
+ <parameter name="ctx-destination" value="prop.random-data"/>
+ <outcome value='success'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="ctx_memory_result_key" value="prop.random-data-list"/>
+ <parameter name="original_string" value="`$prop.random-data`"/>
+ <parameter name="regex" value="-"/>
+ <outcome value='success'></outcome>
+ </execute>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='vnf-id' value="`$prop.random-data-list[3]`"/>
+ <parameter name='vnf-name' value="`'vnf-'+$prop.random-data-list[4]`"/>
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="generic-vnf" key="generic-vnf.vnf-id = $vnf-id" >
+ <parameter name= "vnf-id" value = "`$vnf-id`"/>
+ <parameter name= "vnf-name" value = "`$vnf-name`"/>
+ <parameter name= "vnf-type" value = "AccessConnectivity"/>
+ <parameter name= "service-id" value = "`$vnf-topology-operation-input.service-information.service-id`"/>
+ <parameter name= "prov-status" value = "ACTIVE"/>
+ <parameter name= "orchestration-status" value = "Active"/>
+ <parameter name= "is-closed-loop-disabled" value = "false" />
+ <parameter name= "model-invariant-id" value = "`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`"/>
+ <parameter name= "model-version-id" value = "`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`"/>
+ <parameter name= "model-customization-id" value = "`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`"/>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failure calling AAI to save generic-vnf" />
+ </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="generic-vnf instance does not exist in AAI" />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="service-instance:metadata"
+ key="service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-id
+ AND customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id
+ AND service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type
+ AND service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id" force="true" pfx="tmp.AnAI-data"
+ >
+ <parameter name="metadata.metadatum[0].metaname" value="remote-id" />
+ <parameter name="metadata.metadatum[0].metaval" value="`$prop.bbs.remote_id`" />
+ <parameter name="metadata.metadatum[1].metaname" value="controller-service-id" />
+ <parameter name="metadata.metadatum[1].metaval" value="`$prop.bbs.serviceID`" />
+ <parameter name="metadata.metadatum[2].metaname" value="cvlan" />
+ <parameter name="metadata.metadatum[2].metaval" value="`$prop.bbs.CVLAN`" />
+ <parameter name="metadata.metadatum[3].metaname" value="svlan" />
+ <parameter name="metadata.metadatum[3].metaval" value="`$prop.bbs.SVLAN`" />
+ <parameter name="metadata.metadatum[4].metaname" value="expected-ont-id" />
+ <parameter name="metadata.metadatum[4].metaval" value="`$prop.bbs.ONTSN`" />
+ <!--<parameter name="metadata.metadatum[5].metaname" value="rgw-mac-address" />-->
+ <!--<parameter name="metadata.metadatum[5].metaval" value="`$prop.bbs.mac`" />-->
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failure calling AAI to save metadatum" />
+ </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="metadatum instance does not exist in AAI" />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="service-instance:relationship-list"
+ key="service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-id
+ AND customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id
+ AND service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type
+ AND service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id" force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`'/network/generic-vnfs/generic-vnf/' + $vnf-id`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="generic-vnf.vnf-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$vnf-id`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failure calling AAI to save metadatum" />
+ </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="metadatum instance does not exist in AAI" />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ </block>
+ <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_bbs-access-connectivity-vnf-topology-operation-delete-huawei.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_bbs-access-connectivity-vnf-topology-operation-delete-huawei.xml new file mode 100644 index 00000000..9d50feef --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_bbs-access-connectivity-vnf-topology-operation-delete-huawei.xml @@ -0,0 +1,171 @@ +<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='bbs-access-connectivity-vnf-topology-operation-delete-huawei' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-bbs-vnf-input-parameters' mode='sync' ></call>
+ <set>
+ <parameter name='prop.sdncRestApi.thirdpartySdnc.url' value='https://172.30.0.55:26335' />
+ <parameter name='vnf-input-parameters.' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.`' />
+ </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.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-token-template.json'`"/>
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url+'/rest/plat/smapp/v1/oauth/token'`"/>
+ <parameter name="format" value="json"/>
+ <parameter name="httpMethod" value="put"/>
+ <parameter name="responsePrefix" value="token-result"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error failed to call queryTokenID" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <switch test='`$token-result.accessSession`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing queryTokenID,vaule is null" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.sdncRestApi.token_id' value='`$token-result.accessSession`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ <for index='idx' start='0' end='`$vnf-input-parameters.param_length`' >
+ <switch test="`$vnf-input-parameters.param[$idx].name == 'serviceID'`">
+ <outcome value='true'>
+ <switch test='`$vnf-input-parameters.param[$idx].value`'>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.bbs.serviceID' value='`$vnf-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="$vnf-input-parameters.param[$idx].name +' value is null, please check it.'" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/ws/rest/1002/FanOpenAPI/DeactivateOnt?serviceID='+$prop.bbs.serviceID`" />
+ <parameter name="httpMethod" value="get"/>
+ <parameter name="contentType" value="application/x-www-form-urlencoded"/>
+ <parameter name="responsePrefix" value="service-result"/>
+ <parameter name="customHttpHeaders" value="`'X-Auth-Token=' + $prop.sdncRestApi.token_id`"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error failed to call deleteAccessConnectivityService" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic="true">
+ <switch test="`$service-result.errors.error[0].error-message`">
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error deleteAccessConnectivityService return: '+$service-result.errors.error[0].error-message`" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </execute>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-instance"
+ key="customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id AND
+ service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type AND
+ service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id"
+ pfx='aai.service-instance' local-only='false' >
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <block atomic='true'>
+ <for silentFailure='true' index='ridx' start='0' end="`$aai.service-instance.relationship-list.relationship_length`" >
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.service-instance.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <block atomic='true'>
+ <switch test='`$aai.service-instance.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='generic-vnf.vnf-id'>
+ <block atomic='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $aai.service-instance.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.generic-vnf' local-only='false' >
+ <outcome value='success'>
+ <block atomic='true'>
+ <switch test='`$aai.generic-vnf.vnf-type`'>
+ <outcome value='AccessConnectivity'>
+ <set>
+ <parameter name='prop.bbs.accessConnectivityVNFId' value='`$aai.generic-vnf.vnf-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </for>
+ </block>
+ </outcome>
+ </get-resource>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $prop.bbs.accessConnectivityVNFId">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </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_bbs-internet-profile-vnf-topology-operation-change-huawei.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-change-huawei.xml new file mode 100644 index 00000000..9df1b38f --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-change-huawei.xml @@ -0,0 +1,42 @@ +<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='bbs-internet-profile-vnf-topology-operation-change-huawei' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-vnf-topology-operation-common-huawei' mode='sync' ></call>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-internet-profile-operation.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/ChangeInternetProfileInstance'`" />
+ <parameter name="contentType" value="application/json"/>
+ <parameter name="httpMethod" value="post"/>
+ <parameter name="responsePrefix" value="service-result"/>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error failed to call ChangeInternetProfileInstance" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <switch test="`$service-result.errors.error[0].error-message`">
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error ChangeInternetProfileInstance return: '+$service-result.errors.error[0].error-message`" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ <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_bbs-internet-profile-vnf-topology-operation-common-huawei.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-common-huawei.xml new file mode 100644 index 00000000..4f67b46b --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-common-huawei.xml @@ -0,0 +1,76 @@ +<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='bbs-internet-profile-vnf-topology-operation-common-huawei' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='validate-bbs-vnf-input-parameters' mode='sync' ></call>
+ <set>
+ <parameter name='vnf-input-parameters.' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.`' />
+ <parameter name='prop.sdncRestApi.thirdpartySdnc.url' value='http://172.30.0.121:5000' />
+ <parameter name='prop.bbs.service_id' value='`$vnf-topology-operation-input.service-information.service-id`' />
+ </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>
+ <for index='idx' start='0' end='`$vnf-input-parameters.param_length`' >
+ <block>
+ <switch test="`$vnf-input-parameters.param[$idx].name == 'ip_service_type'`">
+ <outcome value='true'>
+ <switch test='`$vnf-input-parameters.param[$idx].value`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$vnf-input-parameters.param[$idx].name +' value is null, please check it.'`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.bbs.service_type' value='`$vnf-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test="`$vnf-input-parameters.param[$idx].name == 'ip_upstream_speed'`">
+ <outcome value='true'>
+ <switch test='`$vnf-input-parameters.param[$idx].value`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$vnf-input-parameters.param[$idx].name +' value is null, please check it.'`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.bbs.up_speed' value='`$vnf-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ <switch test="`$vnf-input-parameters.param[$idx].name == 'ip_downstream_speed'`">
+ <outcome value='true'>
+ <switch test='`$vnf-input-parameters.param[$idx].value`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`$vnf-input-parameters.param[$idx].name +' value is null, please check it.'`" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.bbs.down_speed' value='`$vnf-input-parameters.param[$idx].value`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-create-huawei.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-create-huawei.xml new file mode 100644 index 00000000..27048ab0 --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-create-huawei.xml @@ -0,0 +1,146 @@ +<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='bbs-internet-profile-vnf-topology-operation-create-huawei' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-vnf-topology-operation-common-huawei' mode='sync' ></call>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-internet-profile-operation.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/CreateInternetProfileInstance'`" />
+ <parameter name="contentType" value="application/json"/>
+ <parameter name="httpMethod" value="post"/>
+ <parameter name="responsePrefix" value="service-result"/>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error failed to call CreateInternetProfileInstance" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <switch test="`$service-result.errors.error[0].error-message`">
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error CreateInternetProfileInstance return: '+$service-result.errors.error[0].error-message`" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ <block>
+ <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID">
+ <parameter name="ctx-destination" value="prop.random-data"/>
+ <outcome value='success'>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
+ <parameter name="ctx_memory_result_key" value="prop.random-data-list"/>
+ <parameter name="original_string" value="`$prop.random-data`"/>
+ <parameter name="regex" value="-"/>
+ <outcome value='success'></outcome>
+ </execute>
+ </outcome>
+ </execute>
+ <set>
+ <parameter name='vnf-id' value="`$prop.random-data-list[3]`"/>
+ <parameter name='vnf-name' value="`'vnf-'+$prop.random-data-list[4]`"/>
+ </set>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="generic-vnf" key="generic-vnf.vnf-id = $vnf-id" >
+ <parameter name= "vnf-id" value = "`$vnf-id`"/>
+ <parameter name= "vnf-name" value = "`$vnf-name`"/>
+ <parameter name= "vnf-type" value = "InternetProfile"/>
+ <parameter name= "service-id" value = "`$vnf-topology-operation-input.service-information.service-id`"/>
+ <parameter name= "prov-status" value = "ACTIVE"/>
+ <parameter name= "orchestration-status" value = "Active"/>
+ <parameter name= "is-closed-loop-disabled" value = "false" />
+ <parameter name= "model-invariant-id" value = "`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`"/>
+ <parameter name= "model-version-id" value = "`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`"/>
+ <parameter name= "model-customization-id" value = "`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`"/>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failure calling AAI to save generic-vnf" />
+ </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="generic-vnf instance does not exist in AAI" />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="service-instance:metadata"
+ key="service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-id
+ AND customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id
+ AND service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type
+ AND service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id" force="true" pfx="tmp.AnAI-data">
+ <parameter name="metadata.metadatum[0].metaname" value="service-type" />
+ <parameter name="metadata.metadatum[0].metaval" value="`$prop.bbs.service_type`" />
+ <parameter name="metadata.metadatum[1].metaname" value="up-speed" />
+ <parameter name="metadata.metadatum[1].metaval" value="`$prop.bbs.up_speed`" />
+ <parameter name="metadata.metadatum[2].metaname" value="down-speed" />
+ <parameter name="metadata.metadatum[2].metaval" value="`$prop.bbs.down_speed`" />
+ <!--<parameter name="metadata.metadatum[3].metaname" value="cvlan" />-->
+ <!--<parameter name="metadata.metadatum[3].metaval" value="`$prop.bbs.c_vlan`" />-->
+ <!--<parameter name="metadata.metadatum[4].metaname" value="svlan" />-->
+ <!--<parameter name="metadata.metadatum[4].metaval" value="`$prop.bbs.s_vlan`" />-->
+ <!--<parameter name="metadata.metadatum[5].metaname" value="expected-ont-id" />-->
+ <!--<parameter name="metadata.metadatum[5].metaval" value="`$prop.bbs.ont_sn`" />-->
+ <!--<parameter name="metadata.metadatum[6].metaname" value="rgw-mac-address" />-->
+ <!--<parameter name="metadata.metadatum[6].metaval" value="`$prop.bbs.mac`" />-->
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failure calling AAI to save metadatum" />
+ </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="metadatum instance does not exist in AAI" />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ <save plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="service-instance:relationship-list"
+ key="service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-id
+ AND customer.global-customer-id = $vnf-topology-operation-input.service-information.global-customer-id
+ AND service-subscription.service-type = $vnf-topology-operation-input.service-information.subscription-service-type
+ AND service-instance.service-instance-id = $vnf-topology-operation-input.service-information.service-instance-id" force="true" pfx="tmp.AnAI-data">
+ <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" />
+ <parameter name="relationship-list.relationship[0].related-link" value="`'/network/generic-vnfs/generic-vnf/' + $vnf-id`" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="generic-vnf.vnf-id" />
+ <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$vnf-id`" />
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Failure calling AAI to save metadatum" />
+ </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="metadatum instance does not exist in AAI" />
+ </return>
+ </outcome>
+ <outcome value='success'></outcome>
+ </save>
+ </block>
+ <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_bbs-internet-profile-vnf-topology-operation-delete-huawei.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-delete-huawei.xml new file mode 100644 index 00000000..4b2e5fb3 --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_bbs-internet-profile-vnf-topology-operation-delete-huawei.xml @@ -0,0 +1,84 @@ +<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='bbs-internet-profile-vnf-topology-operation-delete-huawei' mode='sync'>
+ <block atomic="true">
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-vnf-topology-operation-common-huawei' mode='sync' ></call>
+ <execute plugin="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode" method="sendRequest">
+ <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/bbs-internet-profile-operation.json'`" />
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/DeleteInternetProfileInstance'`" />
+ <parameter name="contentType" value="application/json"/>
+ <parameter name="httpMethod" value="post"/>
+ <parameter name="responsePrefix" value="service-result"/>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error failed to call DeleteInternetProfileInstance" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <switch test="`$service-result.errors.error[0].error-message`">
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'Error DeleteInternetProfileInstance return: '+$service-result.errors.error[0].error-message`" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <block></block>
+ </outcome>
+ </switch>
+ </outcome>
+ </execute>
+ <for silentFailure='false' index='rdidx' start='0' end="`$aai.service-instance.relationship-list.relationship[$ridx].relationship-data_length`" >
+ <block atomic='true'>
+ <switch test='`$aai.service-instance.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-key`'>
+ <outcome value='generic-vnf.vnf-id'>
+ <block atomic='true'>
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $aai.service-instance.relationship-list.relationship[$ridx].relationship-data[$rdidx].relationship-value"
+ pfx='aai.generic-vnf' local-only='false' >
+ <outcome value='success'>
+ <block atomic='true'>
+ <switch test='`$aai.generic-vnf.vnf-type`'>
+ <outcome value='InternetProfile'>
+ <set>
+ <parameter name='prop.bbs.internetProfileVNFId' value='`$aai.generic-vnf.vnf-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ </get-resource>
+ </block>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ <delete plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="generic-vnf"
+ key="generic-vnf.vnf-id = $prop.bbs.internetProfileVNFId">
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </return>
+ </outcome>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='error-code' value='' />
+ <parameter name='error-message' value='' />
+ </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-bbs-vnf-input-parameters.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-bbs-vnf-input-parameters.xml new file mode 100644 index 00000000..7f72fbdb --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-bbs-vnf-input-parameters.xml @@ -0,0 +1,118 @@ +<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-bbs-vnf-input-parameters' mode='sync'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-action`'>
+ <outcome value='create'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateAccessConnectivityInstance'>
+ <switch test='$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error invalid request-action" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='CreateInternetProfileInstance'>
+ <switch test='$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error invalid request-action" />
+ </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="Error invalid request-action" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='delete'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteAccessConnectivityInstance'>
+ <switch test='$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error invalid request-action" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='DeleteInternetProfileInstance'>
+ <switch test='$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error invalid request-action" />
+ </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="Error invalid request-action" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </outcome>
+ <outcome value='update'>
+ <block atomic="true">
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='Other'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error invalid request-action" />
+ </return>
+ </outcome>
+ <outcome value='ChangeInternetProfileInstance'>
+ <switch test='$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error invalid request-action" />
+ </return>
+ </outcome>
+ </switch>
+ </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="`$vnf-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
+ </return>
+ </outcome>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="svc-action is null" />
+ </return>
+ </outcome>
+ </switch>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation.xml index 74ce797f..9b8f9a0a 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation.xml @@ -100,6 +100,39 @@ <outcome value='create'>
<block atomic="true">
<switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='CreateAccessConnectivityInstance'>
+ <for index='idx' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`' >
+ <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'manufacturer'`">
+ <outcome value='true'>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`'>
+ <outcome value='HUAWEI'>
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-access-connectivity-vnf-topology-operation-create-huawei' 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="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name+' is invalid manufacturer,please check!'`" />
+ </return>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='CreateInternetProfileInstance'>
+ <for index='idx' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`' >
+ <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'manufacturer'`">
+ <outcome value='true'>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`'>
+ <outcome value='HUAWEI'>
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-vnf-topology-operation-create-huawei' mode='sync' ></call>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
<outcome value='CreateSiteInstance'>
<call module='GENERIC-RESOURCE-API' rpc='site-vnf-topology-operation-create' mode='sync' ></call>
</outcome>
@@ -131,6 +164,32 @@ <outcome value='delete'>
<block atomic="true">
<switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='DeleteAccessConnectivityInstance'>
+ <for index='idx' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`' >
+ <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'manufacturer'`">
+ <outcome value='true'>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`'>
+ <outcome value='HUAWEI'>
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-access-connectivity-vnf-topology-operation-delete-huawei' mode='sync' ></call>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ <outcome value='DeleteInternetProfileInstance'>
+ <for index='idx' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`' >
+ <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'manufacturer'`">
+ <outcome value='true'>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`'>
+ <outcome value='HUAWEI'>
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-vnf-topology-operation-delete-huawei' mode='sync' ></call>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
<outcome value='DeleteSiteInstance'>
<call module='GENERIC-RESOURCE-API' rpc='site-vnf-topology-operation-delete' mode='sync' ></call>
</outcome>
@@ -159,6 +218,23 @@ </switch>
</block>
</outcome>
+ <outcome value='update'>
+ <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
+ <outcome value='ChangeInternetProfileInstance'>
+ <for index='idx' start='0' end='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`' >
+ <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'manufacturer'`">
+ <outcome value='true'>
+ <switch test='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`'>
+ <outcome value='HUAWEI'>
+ <call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-vnf-topology-operation-change-huawei' mode='sync' ></call>
+ </outcome>
+ </switch>
+ </outcome>
+ </switch>
+ </for>
+ </outcome>
+ </switch>
+ </outcome>
<outcome value='Other'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
|