diff options
Diffstat (limited to 'platform-logic/generic-resource-api/src/main/xml')
3 files changed, 395 insertions, 0 deletions
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_bbs-access-connectivity-network-topology-operation-create-huawei.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_bbs-access-connectivity-network-topology-operation-create-huawei.xml new file mode 100644 index 00000000..c7374bee --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_bbs-access-connectivity-network-topology-operation-create-huawei.xml @@ -0,0 +1,167 @@ +<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-network-topology-operation-create-huawei' mode='sync'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='validate-bbs-network-input-parameters' mode='sync' ></call> + <set> + <parameter name='network-input-parameters.' value='`$network-topology-operation-input.network-request-input.network-input-parameters.`' /> + <parameter name='prop.sdncRestApi.thirdpartySdnc.url' value='https://swisscom.onap.inhuawei.com: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='`$network-input-parameters.param_length`' > + <block> + <switch test="`$network-input-parameters.param[$idx].name == 'accessID'`"> + <outcome value='true'> + <switch test='`$network-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="invalid network-input-parameters.param in bbs-access-connectivity-network-topology-operation-create" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.accessID' value='`$network-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$network-input-parameters.param[$idx].name == 'ONTSN'`"> + <outcome value='true'> + <switch test='`$network-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="invalid network-input-parameters.param in bbs-access-connectivity-network-topology-operation-create" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.ONTSN' value='`$network-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$network-input-parameters.param[$idx].name == 'CVLAN'`"> + <outcome value='true'> + <switch test='`$network-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="invalid network-input-parameters.param in bbs-access-connectivity-network-topology-operation-create" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.CVLAN' value='`$network-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </outcome> + </switch> + <switch test="`$network-input-parameters.param[$idx].name == 'SVLAN'`"> + <outcome value='true'> + <switch test='`$network-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="invalid network-input-parameters.param in bbs-access-connectivity-network-topology-operation-create" /> + </return> + </outcome> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.SVLAN' value='`$network-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="`$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='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 Get token rest api" /> + </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 executing Get token rest api" /> + </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="`$prop.sdncRestApi.thirdpartySdnc.url + '/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"/> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Error executing Get token rest api" /> + </return> + </outcome> + <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 failed: '+$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-access-connectivity-network-topology-operation-delete-huawei.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_bbs-access-connectivity-network-topology-operation-delete-huawei.xml new file mode 100644 index 00000000..b0dc0c9d --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_bbs-access-connectivity-network-topology-operation-delete-huawei.xml @@ -0,0 +1,110 @@ +<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-network-topology-operation-delete-huawei' mode='sync'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='validate-bbs-network-input-parameters' mode='sync' ></call> + <set> + <parameter name='prop.sdncRestApi.thirdpartySdnc.url' value='https://swisscom.onap.inhuawei.com:26335' /> + <parameter name='network-input-parameters.' value='`$network-topology-operation-input.network-request-input.network-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 executing Get token rest api" /> + </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 Get token rest api" /> + </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='`$network-input-parameters.param_length`' > + <switch test="`$network-input-parameters.param[$idx].name == 'serviceID'`"> + <outcome value='true'> + <switch test='`$network-input-parameters.param[$idx].value`'> + <outcome value='Other'> + <set> + <parameter name='prop.bbs.serviceID' value='`$network-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="invalid network-input-parameters.param in bbs-access-connectivity-network-topology-operation-delete" /> + </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="invalid network-input-parameters.param in bbs-access-connectivity-network-topology-operation-delete" /> + </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 failed: '+$service-result.errors.error[0].error-message`" /> + </return> + </outcome> + <outcome value=''> + <block></block> + </outcome> + </switch> + </block> + </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_validate-bbs-network-input-parameters.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-bbs-network-input-parameters.xml new file mode 100644 index 00000000..207a338c --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-bbs-network-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-network-input-parameters' mode='sync'> + <block atomic="true"> + <switch test='`$network-topology-operation-input.sdnc-request-header.svc-action`'> + <outcome value='create'> + <block atomic="true"> + <switch test='`$network-topology-operation-input.request-information.request-action`'> + <outcome value='CreateAccessConnectivityInstance'> + <switch test='$network-topology-operation-input.network-request-input.network-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='$network-topology-operation-input.network-request-input.network-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='`$network-topology-operation-input.request-information.request-action`'> + <outcome value='DeleteAccessConnectivityInstance'> + <switch test='$network-topology-operation-input.network-request-input.network-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='$network-topology-operation-input.network-request-input.network-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='change'> + <block atomic="true"> + <switch test='`$network-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='$network-topology-operation-input.network-request-input.network-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="`$network-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 |