diff options
Diffstat (limited to 'platform-logic/generic-resource-api/src/main/xml')
2 files changed, 231 insertions, 75 deletions
diff --git a/platform-logic/generic-resource-api/src/main/xml/p2p_eline/GENERIC-RESOURCE-API_p2p-vnf-topology-operation-p2p-callbackdg-notification.xml b/platform-logic/generic-resource-api/src/main/xml/p2p_eline/GENERIC-RESOURCE-API_p2p-vnf-topology-operation-p2p-callbackdg-notification.xml index e3d1c939..4a117b4c 100644 --- a/platform-logic/generic-resource-api/src/main/xml/p2p_eline/GENERIC-RESOURCE-API_p2p-vnf-topology-operation-p2p-callbackdg-notification.xml +++ b/platform-logic/generic-resource-api/src/main/xml/p2p_eline/GENERIC-RESOURCE-API_p2p-vnf-topology-operation-p2p-callbackdg-notification.xml @@ -13,67 +13,211 @@ <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' /> <parameter name='contextPrefix' value='prop' /> </execute> - <switch test="`$push-change-update.datastore-changes.type == 'update' `"> - <outcome value='true'> - <block atomic="true"> - <set> - <!--<parameter name='rcvdNotif' value='`$notifvalue`' />--> - <parameter name='rcvd-etht-svc-end-point' value='`$push-change-update.datastore-changes.payload.parameter-value[0].etht-svc-end-point`' /> - <parameter name='rcvd-subscription-id' value='`$push-change-update.subscription-id`' /> - <parameter name='rcvd-bandwidth-value' value='`$push-change-update.datastore-changes.payload.parameter-value[0].value`' /> - <parameter name='rcvd-service-instance-id' value='`$push-change-update.datastore-changes.payload.parameter-value[0].value-description`' /> - </set> - <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource="service-instance:metadata" + <block atomic="true"> + <set> + <parameter name='rcvd-etht-svc-end-point' value='`$performance-monitoring.service-pm[0].service-pm-state.performance-data[3].parameter-value[0].index`' /> + <!--<parameter name='rcvd-subscription-id' value='`$push-change-update.subscription-id`' />--> + <parameter name='rcvd-bandwidth-value' value='`$performance-monitoring.service-pm[0].service-pm-state.performance-data[3].parameter-value[0].value`' /> + <parameter name='rcvd-etht-service-name' value='`$performance-monitoring.service-pm[0].service-name`' /> + </set> + <set> + <parameter name='found-connectivity' value="false" /> + </set> + <set> + <parameter name='tmp.the-connectivity.' value="" /> + <parameter name='rcvd-service-instance-id' value="" /> + </set> + <set> + <parameter name='tmp.aai.helper-all-connectivities.' value="" /> + </set> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="connectivities" + key="selflink = 'https://aai.onap:8443/aai/v24/network/connectivities/'" + local-only="false" + pfx="tmp.aai.helper-all-connectivities" > + <outcome value='success'> + <block atomic="true"> + <for index='helpconnidx' start='0' end='`$tmp.aai.helper-all-connectivities.connectivity_length`' > + <block atomic='true'> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log" /> + <parameter name="level" value="info" /> + <parameter name="field1" value="`$tmp.aai.helper-all-connectivities.connectivity[$helpconnidx].etht-svc-name`"/> + </record> + <switch test='`$tmp.aai.helper-all-connectivities.connectivity[$helpconnidx].etht-svc-name == $rcvd-etht-service-name`'> + <outcome value='false'> + <block></block> + </outcome> + <outcome value='true'> + <block> + <for silentFailure='true' index='cridx' start='0' end='`$tmp.aai.helper-all-connectivities.connectivity[$helpconnidx].relationship-list.relationship_length`' > + <switch test='`$tmp.aai.helper-all-connectivities.connectivity[$helpconnidx].relationship-list.relationship[$cridx].related-to`'> + <outcome value='service-instance'> + <block atomic="true"> + <set> + <parameter name='rcvd-service-instance-id' value="`$tmp.aai.helper-all-connectivities.connectivity[$helpconnidx].relationship-list.relationship[$cridx].relationship-data[2].relationship-value`" /> + </set> + <break/> + </block> + </outcome> + </switch> + </for> + </block> + </outcome> + </switch> + </block> + </for> + </block> + </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.l3vpn.pe1_id`" /> + </return> + </outcome> + <outcome value='failure'> + <return status='failure'> + <parameter name='error-code' value='' /> + <parameter name='error-message' value='' /> + </return> + </outcome> + </get-resource> + <set> + <parameter name='tmp.metavalue' value='' /> + </set> + <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" + resource="metadatum" key="service-instance.service-instance-id = $rcvd-service-instance-id + AND customer.global-customer-id = 'IBNCustomer' + AND service-subscription.service-type = 'IBN' + AND metadatum.metaname = $rcvd-etht-svc-end-point" + local-only="false" + force="true" pfx="tmp.aai.service-instance.metadatum"> + <outcome value='success'> + <block> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log" /> + <parameter name="level" value="info" /> + <parameter name="field1" value="`$tmp.aai.service-instance.metadatum.metaval`"/> + </record> + <switch test="`length($tmp.aai.service-instance.metadatum.metaval) == 0`"> + <outcome value='true'> + <block> + <set> + <parameter name='tmp.metavalue' value='2000000' /> + </set> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log" /> + <parameter name="level" value="info" /> + <parameter name="field1" value="`$tmp.metavalue`"/> + </record> + <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource="service-instance:metadata" + key="service-instance.service-instance-id = $rcvd-service-instance-id AND customer.global-customer-id = 'IBNCustomer' AND service-subscription.service-type = 'IBN'" force="true" pfx="tmp.AnAI-data"> - <parameter name="metadata.metadatum[0].metaname" value="`$rcvd-etht-svc-end-point`" /> - <parameter name="metadata.metadatum[0].metaval" value="`$rcvd-bandwidth-value`" /> - </save> - <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource="service-instance" - key="service-instance.service-instance-id = $rcvd-service-instance-id + <parameter name="metadata.metadatum[0].metaname" value="`$rcvd-etht-svc-end-point`" /> + <parameter name="metadata.metadatum[0].metaval" value="`$tmp.metavalue`" /> + </save> + </block> + </outcome> + <outcome value='false'> + <block> + <set> + <parameter name='tmp.metavalue' value='`$tmp.aai.service-instance.metadatum.metaval + 500000`' /> + </set> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log" /> + <parameter name="level" value="info" /> + <parameter name="field1" value="`$tmp.metavalue`"/> + </record> + <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource="service-instance" + key="service-instance.service-instance-id = $rcvd-service-instance-id AND customer.global-customer-id = 'IBNCustomer' AND service-subscription.service-type = 'IBN' AND metadatum.metaname = $rcvd-etht-svc-end-point" force="true" pfx="tmp.AnAI-data"> - <parameter name="metaname" value="`$rcvd-etht-svc-end-point`" /> - <parameter name="metaval" value="`$rcvd-bandwidth-value`" /> - <!--AND metadatum.metaname = $rcvd-etht-svc-end-point--> - <!--<parameter name="metadata.metadatum[0].metaname" value="`$rcvd-etht-svc-end-point`" />--> - <!-- <parameter name="metadata.metadatum[0].metaval" value="`$rcvd-bandwidth-value`" />--> - </update> - <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='generateUUID' > - <parameter name="ctx-destination" value="eventId-uuid"/> - </execute> - <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='generateUUID' > - <parameter name="ctx-destination" value="eventName-uuid"/> - </execute> - <set> - <parameter name='eventIdUuid' value="`'BandwidthChanged_' + $eventId-uuid`" /> - <parameter name='eventNameUuid' value='`$eventName-uuid`' /> - <parameter name='cclId' value='`$rcvd-service-instance-id`' /> - <parameter name='uniId' value='`$rcvd-etht-svc-end-point`' /> - <parameter name='bandwidthValue' value='`$rcvd-bandwidth-value`' /> - </set> - <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > - <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/' + $prop.restapi.p2p-call-ves.templatefile`" /> - <!--<parameter name="restapiUrl" value="`$prop.dcaeAddrAndPort + '/eventListener/v7'`" />--> - <parameter name="restapiUrl" value="https://dcae-ves-collector:8443/eventListener/v7" /> - <parameter name="restapiUser" value="sample1" /> - <parameter name="restapiPassword" value="sample1" /> - <parameter name="format" value="json"/> - <parameter name="httpMethod" value="post"/> - <parameter name='dirPath' value="/opt/onap/sdnc/restconfapi/yang" /> - <parameter name="responsePrefix" value="ves-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="disableHostVerification" value="true"/> - <parameter name="ssl" value="false"/> - </execute> - </block> - </outcome> - </switch> + <parameter name="metaname" value="`$rcvd-etht-svc-end-point`" /> + <parameter name="metaval" value="`$tmp.metavalue`" /> + <!--AND metadatum.metaname = $rcvd-etht-svc-end-point--> + <!--<parameter name="metadata.metadatum[0].metaname" value="`$rcvd-etht-svc-end-point`" />--> + <!-- <parameter name="metadata.metadatum[0].metaval" value="`$rcvd-bandwidth-value`" />--> + </update> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value='not-found'> + <block> + <set> + <parameter name='tmp.metavalue' value='2000000' /> + </set> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log" /> + <parameter name="level" value="info" /> + <parameter name="field1" value="`$tmp.metavalue`"/> + </record> + <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource="service-instance:metadata" + key="service-instance.service-instance-id = $rcvd-service-instance-id + AND customer.global-customer-id = 'IBNCustomer' + AND service-subscription.service-type = 'IBN'" force="true" pfx="tmp.AnAI-data"> + <parameter name="metadata.metadatum[0].metaname" value="`$rcvd-etht-svc-end-point`" /> + <parameter name="metadata.metadatum[0].metaval" value="`$tmp.metavalue`" /> + </save> + </block> + </outcome> + <outcome value='failure'> + <block> + <set> + <parameter name='tmp.metavalue' value='2000000' /> + </set> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log" /> + <parameter name="level" value="info" /> + <parameter name="field1" value="`$tmp.metavalue`"/> + </record> + <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource="service-instance:metadata" + key="service-instance.service-instance-id = $rcvd-service-instance-id + AND customer.global-customer-id = 'IBNCustomer' + AND service-subscription.service-type = 'IBN'" force="true" pfx="tmp.AnAI-data"> + <parameter name="metadata.metadatum[0].metaname" value="`$rcvd-etht-svc-end-point`" /> + <parameter name="metadata.metadatum[0].metaval" value="`$tmp.metavalue`" /> + </save> + </block> + </outcome> + </get-resource> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='generateUUID' > + <parameter name="ctx-destination" value="eventId-uuid"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='generateUUID' > + <parameter name="ctx-destination" value="eventName-uuid"/> + </execute> + <set> + <parameter name='eventIdUuid' value="`'BandwidthChanged_' + $eventId-uuid`" /> + <parameter name='eventNameUuid' value='`$eventName-uuid`' /> + <parameter name='cclId' value='`$rcvd-service-instance-id`' /> + <parameter name='uniId' value='`$rcvd-etht-svc-end-point`' /> + <!--<parameter name='bandwidthValue' value='`$rcvd-bandwidth-value`' />--> + <parameter name='bandwidthValue' value='`$tmp.metavalue`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/' + $prop.restapi.p2p-call-ves.templatefile`" /> + <!--<parameter name="restapiUrl" value="`$prop.dcaeAddrAndPort + '/eventListener/v7'`" />--> + <parameter name="restapiUrl" value="https://dcae-ves-collector:8443/eventListener/v7" /> + <parameter name="restapiUser" value="sample1" /> + <parameter name="restapiPassword" value="sample1" /> + <parameter name="format" value="json"/> + <parameter name="httpMethod" value="post"/> + <parameter name='dirPath' value="/opt/onap/sdnc/restconfapi/yang" /> + <parameter name="responsePrefix" value="ves-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="disableHostVerification" value="true"/> + <parameter name="ssl" value="false"/> + </execute> + </block> </block> </method> </service-logic>
\ No newline at end of file diff --git a/platform-logic/generic-resource-api/src/main/xml/p2p_eline/GENERIC-RESOURCE-API_p2p-vnf-topology-operation-p2p-delete.xml b/platform-logic/generic-resource-api/src/main/xml/p2p_eline/GENERIC-RESOURCE-API_p2p-vnf-topology-operation-p2p-delete.xml index 599cd075..62163093 100644 --- a/platform-logic/generic-resource-api/src/main/xml/p2p_eline/GENERIC-RESOURCE-API_p2p-vnf-topology-operation-p2p-delete.xml +++ b/platform-logic/generic-resource-api/src/main/xml/p2p_eline/GENERIC-RESOURCE-API_p2p-vnf-topology-operation-p2p-delete.xml @@ -148,26 +148,38 @@ <outcome value='failure'></outcome> <outcome value='success'> <block> - <execute plugin='org.onap.ccsdk.sli.plugins.restconfdiscovery.PeriodicDiscoveryNode' method='deleteSubscription' > - <parameter name="subscriberId" value="`$prop.sdncRestApi.thirdpartySdnc.domain.url`" /> - <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/' + $prop.restapi.cll-terminate-notification.templatefile`" /> - <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.domain.url + '/restconf/operations/ietf-subscribed-notifications:delete-subscription'`" /> - <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.domain.user`" /> - <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.domain.password`" /> - <parameter name="dirPath" value="/opt/sdnc/restconfapi/yang/notification" /> - <parameter name="format" value="json" /> - <parameter name="httpMethod" value="post" /> - <!--<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='customHttpHeaders' value="X-ACCESS-TOKEN=x-ik2ps4ikvzupbx0486ft1ebzs7rt85futh9ho6eofy3wjsap7wqktemlqm4bbsmnar3vrtbyrzukbv5itd6m1cftldpjarnyle3sdcqq9hftc4lebz464b5ffxmlbvg9" />--> - <parameter name="module" value="GENERIC-RESOURCE-API" /> - <parameter name="rpc" value="p2p-vnf-topology-operation-p2p-callbackdg-notification" /> - <parameter name="version" value="`$project.version`" /> - <parameter name="mode" value="sync" /> - <parameter name="responsePrefix" value="restapi-result"/> - </execute> + <switch test="`length($tmp.aai.vpn-binding.dst-access-ltp-id) == 0`"> + <outcome value='false'> + <switch test="`length($tmp.aai.vpn-binding.src-access-ltp-id) == 0`"> + <outcome value='true'></outcome> + <outcome value='false'> + <block atomic="true"> + <execute plugin='org.onap.ccsdk.sli.plugins.restconfdiscovery.PeriodicDiscoveryNode' method='deleteSubscription' > + <parameter name="subscriberId" value="`$prop.sdncRestApi.thirdpartySdnc.domain.url`" /> + <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/' + $prop.restapi.cll-terminate-notification.templatefile`" /> + <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.domain.url + '/restconf/operations/ietf-subscribed-notifications:delete-subscription'`" /> + <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.domain.user`" /> + <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.domain.password`" /> + <parameter name="dirPath" value="/opt/sdnc/restconfapi/yang/notification" /> + <parameter name="format" value="json" /> + <parameter name="httpMethod" value="post" /> + <!--<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='customHttpHeaders' value="X-ACCESS-TOKEN=x-ik2ps4ikvzupbx0486ft1ebzs7rt85futh9ho6eofy3wjsap7wqktemlqm4bbsmnar3vrtbyrzukbv5itd6m1cftldpjarnyle3sdcqq9hftc4lebz464b5ffxmlbvg9" />--> + <parameter name="module" value="GENERIC-RESOURCE-API" /> + <parameter name="rpc" value="p2p-vnf-topology-operation-p2p-callbackdg-notification" /> + <parameter name="version" value="`$project.version`" /> + <parameter name="mode" value="sync" /> + <parameter name="responsePrefix" value="restapi-result"/> + </execute> + </block> + </outcome> + </switch> + </outcome> + <outcome value='true'></outcome> + </switch> </block> </outcome> </execute> |