diff options
Diffstat (limited to 'platform-logic/vnfapi/src/main/xml')
33 files changed, 3112 insertions, 0 deletions
diff --git a/platform-logic/vnfapi/src/main/xml/dg-generate-l3network-network-id.xml b/platform-logic/vnfapi/src/main/xml/dg-generate-l3network-network-id.xml new file mode 100644 index 00000000..443be5b4 --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-generate-l3network-network-id.xml @@ -0,0 +1,48 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc="generate-l3network-network-id" mode="sync"><block atomic="true"><set> + <parameter name="tmp.local-variables.generate-l3network-network-id." value="" /> + <parameter name="tmp.return.generate-l3network-network-id." value="" /></set><execute plugin="org.openecomp.sdnc.sli.SliPluginUtils.SliPluginUtils" method="generateUUID" > + <parameter name="ctx-destination" value="tmp.return.generate-l3network-network-id.uuid" /><outcome value='failure'> +<return status='failure'> + <!-- Used to work around execute node bug --> + <parameter name="execute_failure" value="false" /> + + <!-- return parameters --> + <parameter name="error-message.generate-l3network-network-id" value="An error occured while generating a UUID for L3-NETWORK." /></return></outcome></execute><for atomic="true" index="n" start="0" end="1" ><get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid" + local-only="false" + pfx="tmp.local-variables.generate-l3network-network-id.L3NETWORK" ><outcome value='success'> +<block atomic='true'><set> + <parameter name="tmp.local-variables.generate-l3network-network-id.is-unique" value="0" /></set><execute plugin="org.openecomp.sdnc.sli.SliPluginUtils.SliPluginUtils" method="generateUUID" > + <parameter name="ctx-destination" value="tmp.return.generate-l3network-network-id.uuid" /><outcome value='failure'> +<return status="failure"> + <!-- return parameters --> + <parameter name="error-message.generate-l3network-network-id" value="An error occured while generating a UUID for L3-NETWORK." /></return></outcome></execute></block></outcome><outcome value='not-found'> +<block></block></outcome><outcome value='failure'> +<return status="failure"> + <!-- return parameters --> + <parameter name="error-message.generate-l3network-network-id" value="`'An error occured while checking if a generated l3network-network-id was unique. network-id = ' + $tmp.local-variables.generate-l3network-network-id.uuid`" /></return></outcome><outcome value="Other"><return status="failure"> + <!-- return parameters --> + <parameter name="error-message.generate-l3network-network-id" value="`'An error occured while checking if a generated l3network-network-id was unique. network-id = ' + $tmp.local-variables.generate-l3network-network-id.uuid`" /></return></outcome></get-resource></for><set> + <parameter name="tmp.local-variables.generate-l3network-network-id." value="" /></set></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-generate-subnets-subnet-id.xml b/platform-logic/vnfapi/src/main/xml/dg-generate-subnets-subnet-id.xml new file mode 100644 index 00000000..c33fe9ad --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-generate-subnets-subnet-id.xml @@ -0,0 +1,49 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc="generate-subnets-subnet-id" mode="sync"><block atomic="true"><set> + <parameter name="tmp.local-variables.generate-subnets-subnet-id." value="" /> + <parameter name="tmp.return.generate-subnets-subnet-id." value="" /></set><execute plugin="org.openecomp.sdnc.sli.SliPluginUtils.SliPluginUtils" method="generateUUID" > + <parameter name="ctx-destination" value="tmp.return.generate-subnets-subnet-id.uuid" /><outcome value='failure'> +<return status='failure'> + <!-- Used to work around execute node bug --> + <parameter name="execute_failure" value="false" /> + + <!-- return parameters --> + <parameter name="error-message.generate-l3network-network-id" value="An error occured while generating a UUID for L3-NETWORK." /></return></outcome></execute><for atomic="true" index="s" start="0" end="1" ><get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="subnet" + key="l3-network.network-id = $tmp.local.network-id + AND subnet.subnet-id = $tmp.return.generate-subnets-subnet-id.uuid" + local-only="false" + pfx="tmp.local-variables.generate-subnets-subnet-id.SUBNETS" ><outcome value='success'> +<block atomic='true'><set> + <parameter name="tmp.local-variables.generate-subnets-subnet-id.is-unique" value="0" /></set><execute plugin="org.openecomp.sdnc.sli.SliPluginUtils.SliPluginUtils" method="generateUUID" > + <parameter name="ctx-destination" value="tmp.return.generate-subnets-subnet-id.uuid" /><outcome value='failure'> +<return status="failure"> + <!-- return parameters --> + <parameter name="error-message.generate-subnets-subnet-id" value="An error occured while generating a UUID for SUBNETS." /></return></outcome></execute></block></outcome><outcome value='not-found'> +<block></block></outcome><outcome value='failure'> +<return status="failure"> + <!-- return parameters --> + <parameter name="error-message.generate-subnets-subnet-id" value="`'An error occured while checking if a generated subnets-subnet-id was unique. subnet-id = ' + $tmp.local-variables.generate-subnets-subnet-id.uuid`" /></return></outcome><outcome value="Other"><return status="failure"> + <!-- return parameters --> + <parameter name="error-message.generate-subnets-subnet-id" value="`'An error occured while checking if a generated subnets-subnet-id was unique. subnet-id = ' + $tmp.local-variables.generate-subnets-subnet-id.uuid`" /></return></outcome></get-resource></for><set> + <parameter name="tmp.local-variables.generate-subnets-subnet-id." value="" /></set></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-network-topology-assign.xml b/platform-logic/vnfapi/src/main/xml/dg-network-topology-assign.xml new file mode 100644 index 00000000..650f0240 --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-network-topology-assign.xml @@ -0,0 +1,358 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc="network-topology-assign" mode="sync"><block atomic="true"><switch test="`$network-topology-operation-input.service-information.service-type`"><outcome value=''><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value='service-type, aka AnAI subscription-service-type, is required.'/></return></outcome></switch><switch test="`$network-topology-operation-input.service-information.subscriber-name`"><outcome value=''><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value='subscriber-name, aka AnAI global-customer-id, is required.'/></return></outcome></switch><get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-name = $network-topology-operation-input.network-request-information.network-name" + local-only="false" + pfx="tmp.AnAI.l3network.existed"> + +<outcome value='failure'> +<return status='failure'> +<parameter name='error-code' value='500' /> +<parameter name='error-message' value="`'An error occurred while querying whether l3-network with network-name = ' + $network-topology-operation-input.network-request-information.network-name + ' already exists in AnAI'`"/> +</return></outcome><outcome value='success'> +<return status='failure'> +<parameter name='error-code' value='500' /> +<parameter name='error-message' value="`'A l3-network with network-name = ' + $network-topology-operation-input.network-request-information.network-name + ' already existed in AnAI with network-id = ' + $tmp.AnAI.l3network.existed.network-id`" /> +</return></outcome></get-resource><set> + <parameter name="tmp.error-message" value=""/></set><call module="VNF-API" rpc="generate-l3network-network-id" mode="sync" > +<outcome value='failure'> +<return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value='Error in generating l3-network.network-id in SDNC'/></return></outcome></call><save plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid" > +<!-- Create l3-network object --> +<parameter name="network-id" value="`$tmp.return.generate-l3network-network-id.uuid`" /> +<parameter name="network-name" value="`$network-topology-operation-input.network-request-information.network-name`" /> +<parameter name="network-type" value="`$network-topology-operation-input.network-request-information.network-type`" /> +<parameter name="network-role" value="`$preload-data.network-topology-information.network-topology-identifier.network-role`" /> +<parameter name="network-technology" value="`$preload-data.network-topology-information.network-topology-identifier.network-technology`" /> +<parameter name="service-id" value="`$network-topology-operation-input.service-information.service-id`" /> +<parameter name="tenant-id" value="`$network-topology-operation-input.network-request-information.tenant`" /> +<parameter name="network-role-instance" value="0" /> +<parameter name="orchestration-status" value="pending-create" /><outcome value='failure'> +<return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Failed to save l3-netework in AnAI with network-id = ' + $tmp.return.generate-l3network-network-id.uuid`"/></return></outcome><outcome value='not-found'> +<return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Failed to save l3-netework in AnAI with network-id = ' + $tmp.return.generate-l3network-network-id.uuid`"/></return></outcome></save><update plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid" > +<parameter name="physical-network-name" value="`$preload-data.network-topology-information.provider-network-information.physical-network-name`" /> +<parameter name="is-provider-network" value="`$preload-data.network-topology-information.provider-network-information.is-provider-network`" /> +<parameter name="is-shared-network" value="`$preload-data.network-topology-information.provider-network-information.is-shared-network`" /> +<parameter name="is-external-network" value="`$preload-data.network-topology-information.provider-network-information.is-external-network`" /><outcome value='failure'> +<block atomic='true'><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'An error occurred while updating l3-network with provider-network-information in AnAI where network-id = ' + $tmp.return.generate-l3network-network-id.uuid`"/></set><block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/></return></block></block></outcome><outcome value='not-found'> +<block atomic='true'><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'An error occurred while updating l3-network with provider-network-information in AnAI where network-id = ' + $tmp.return.generate-l3network-network-id.uuid`"/></set><block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/></return></block></block></outcome></update><for index="i" start="0" end="`$preload-data.network-topology-information.subnets_length`"> +<block atomic='true'><switch test="`$preload-data.network-topology-information.subnets[$i].dhcp-enabled`"><outcome value='Y'><set> +<parameter name="tmp.dhcpEnabled.boolean" value="true" /> +</set></outcome><outcome value='N'><set> +<parameter name="tmp.dhcpEnabled.boolean" value="false" /> +</set></outcome></switch><set> +<parameter name="tmp.gateway-address" value="`$preload-data.network-topology-information.subnets[$i].gateway-address`" /> +</set><switch test="`$preload-data.network-topology-information.subnets[$i].gateway-address`"><outcome value=''><block atomic='true'><execute plugin="org.openecomp.sdnc.sli.plugin.ipAddressTools.IpAddressTool" method="getGatewayAddress"> + <parameter name="ipAddress" value="`$preload-data.network-topology-information.subnets[$i].start-address`" /> + <parameter name="ipVersion" value="`$preload-data.network-topology-information.subnets[$i].ip-version`" /> + <parameter name="subnet" value="`$preload-data.network-topology-information.subnets[$i].cidr-mask`" /> + <parameter name="ctxVariable" value="tmp.return.generate.gateway-address" /></execute><set> +<parameter name="tmp.gateway-address" value="`$tmp.return.generate.gateway-address`" /> +</set></block></outcome></switch><set> +<parameter name="tmp.local.network-id" value="`$tmp.return.generate-l3network-network-id.uuid`" /> +</set><call module="VNF-API" rpc="generate-subnets-subnet-id" mode="sync" > +<outcome value='failure'> +<block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/></return></block></outcome></call><save plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="subnet" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid + AND subnet.subnet-id = $tmp.return.generate-subnets-subnet-id.uuid" > +<!-- Create l3-network object --> +<parameter name="network-id" value="`$tmp.return.generate-l3network-network-id.uuid`" /> +<parameter name="subnet-id" value="`$tmp.return.generate-subnets-subnet-id.uuid`" /> +<parameter name="subnet-name" value="`$preload-data.network-topology-information.subnets[$i].subnet-name`" /> +<parameter name="gateway-address" value="`$tmp.gateway-address`" /> +<parameter name="network-start-address" value="`$preload-data.network-topology-information.subnets[$i].start-address`" /> +<parameter name="cidr-mask" value="`$preload-data.network-topology-information.subnets[$i].cidr-mask`" /> +<parameter name="ip-version" value="`$preload-data.network-topology-information.subnets[$i].ip-version`" /> +<parameter name="dhcp-start" value="`$preload-data.network-topology-information.subnets[$i].dhcp-start-address`" /> +<parameter name="dhcp-end" value="`$preload-data.network-topology-information.subnets[$i].dhcp-end-address`" /> +<parameter name="dhcp-enabled" value="`$tmp.dhcpEnabled.boolean`" /> + <parameter name="orchestration-status" value="pending-create" /><outcome value='failure'> +<block atomic='true'><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'An error occurred while saving l3-newtork.subnet in AnAI where subnet-id = ' + $tmp.return.generate-subnets-subnet-id.uuid`"/></set><block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/></return></block></block></outcome><outcome value='not-found'> +<block atomic='true'><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'An error occurred while saving l3-newtork.subnet in AnAI where subnet-id = ' + $tmp.return.generate-subnets-subnet-id.uuid`"/></set><block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/></return></block></block></outcome></save></block></for><save plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network:relationship-list" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid" + force="true" + local-only="false"> + <!-- create relationship-list --> + <parameter name="relationship-list.relationship[0].related-to" value="tenant" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="cloud-region.cloud-owner" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="att-aic" /> + <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-key" value="cloud-region.cloud-region-id" /> + <parameter name="relationship-list.relationship[0].relationship-data[1].relationship-value" value="`$network-topology-operation-input.network-request-information.aic-cloud-region`" /> + <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-key" value="tenant.tenant-id" /> + <parameter name="relationship-list.relationship[0].relationship-data[2].relationship-value" value="`$network-topology-operation-input.network-request-information.tenant`" /> + <parameter name="relationship-list.relationship[1].related-to" value="cloud-region" /> + <parameter name="relationship-list.relationship[1].relationship-data[0].relationship-key" value="cloud-region.cloud-owner" /> + <parameter name="relationship-list.relationship[1].relationship-data[0].relationship-value" value="att-aic" /> + <parameter name="relationship-list.relationship[1].relationship-data[1].relationship-key" value="cloud-region.cloud-region-id" /> + <parameter name="relationship-list.relationship[1].relationship-data[1].relationship-value" value="`$network-topology-operation-input.network-request-information.aic-cloud-region`" /><outcome value='failure'> +<block atomic='true'><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'An error occurred while saving tenant and clould-region relationship for l3-network in AnAI where network-id = ' + $tmp.return.generate-l3network-network-id.uuid`"/></set><block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/></return></block></block></outcome><outcome value='not-found'> +<block atomic='true'><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'An error occurred while saving tenant and clould-region relationship for l3-network in AnAI where network-id = ' + $tmp.return.generate-l3network-network-id.uuid`"/></set><block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/></return></block></block></outcome></save><switch test="`$preload-data.network-topology-information.vpn-bindings_length`"><outcome value=''><set> +<parameter name="preload-data.network-topology-information.vpn-bindings_length" value="0" /> +</set></outcome></switch><for index="i" start="0" end="`$preload-data.network-topology-information.vpn-bindings_length`"> +<block atomic='true'><set> +<parameter name="tmp.vpn-binding-id" value="" /> +</set><switch test="`$preload-data.network-topology-information.vpn-bindings[$i].vpn-binding-id`"><outcome value='Other'> +<set> +<parameter name="tmp.vpn-binding-id" value="`$preload-data.network-topology-information.vpn-bindings[$i].vpn-binding-id`" /> +</set></outcome></switch><switch test="`$preload-data.network-topology-information.vpn-bindings[$i].global-route-target != ''`" ><outcome value='true'> +<get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="vpn-binding" + key="vpn-binding.global-route-target = $preload-data.network-topology-information.vpn-bindings[$i].global-route-target" + local-only="false" + pfx="tmp.AnAI.vpn-binding"><outcome value='success'> +<switch test="`$tmp.AnAI.vpn-binding.vpn-id`" ><outcome value='Other'> +<set> +<parameter name="tmp.vpn-binding-id" value="`$tmp.AnAI.vpn-binding.vpn-id`" /> +</set></outcome><outcome value=''> +<block atomic='true'><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'Failed to query vpn-bindings from AnAI where global-route-target = ' + $preload-data.network-topology-information.vpn-bindings[$i].global-route-target + '. It is likely that the same global-route-target points to more than one vpn-binding objects in AnAI.'`"/></set><block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/></return></block></block></outcome></switch></outcome><outcome value='not-found'> +<block atomic='true'><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'Failed to query vpn-bindings from AnAI where global-route-target = ' + $preload-data.network-topology-information.vpn-bindings[$i].global-route-target`"/></set><block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/></return></block></block></outcome><outcome value='failure'> +<block atomic='true'><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'Failed to query vpn-bindings from AnAI where global-route-target = ' + $preload-data.network-topology-information.vpn-bindings[$i].global-route-target`"/></set><block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/></return></block></block></outcome></get-resource></outcome></switch><switch test="`$tmp.vpn-binding-id != ''`"><outcome value='true'> +<save plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network:relationship-list" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid" + force="true" + local-only="false"> + + <parameter name="relationship-list.relationship[0].related-to" value="vpn-binding" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="vpn-binding.vpn-id" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.vpn-binding-id`" /><outcome value='failure'> +<block atomic='true'><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'An error occurred while saving vpn-binding relationship for l3-network in AnAI where vpn-id = ' + $tmp.vpn-binding-id`"/></set><block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/></return></block></block></outcome><outcome value='not-found'> +<block atomic='true'><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'An error occurred while saving vpn-binding relationship for l3-network in AnAI where vpn-id = ' + $tmp.vpn-binding-id`"/></set><block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/></return></block></block></outcome><outcome value='success'> +<set> +<parameter name="tmp.is-bound-to-vpn" value="true" /> +</set></outcome></save></outcome></switch></block></for><switch test="`$preload-data.network-topology-information.network-policy_length`"><outcome value=''><set> +<parameter name='preload-data.network-topology-information.network-policy_length' value='0' /> +</set></outcome></switch><for index="i" start="0" end="`$preload-data.network-topology-information.network-policy_length`"> +<switch test="`$preload-data.network-topology-information.network-policy[$i].network-policy-fqdn != ''`"><outcome value='true'> +<get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="network-policy" + key="network-policy.network-policy-fqdn = $preload-data.network-topology-information.network-policy[$i].network-policy-fqdn" + local-only="false" + pfx="tmp.AnAI.network-policy"><outcome value='not-found'> +<block atomic='true'><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'Failed to query network-policy n AnAI where network-policy-fqdn = ' + $preload-data.network-topology-information.network-policy[$i].network-policy-fqdn`"/></set><block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/></return></block></block></outcome><outcome value='failure'> +<block atomic='true'><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'Failed to query network-policy n AnAI where network-policy-fqdn = ' + $preload-data.network-topology-information.network-policy[$i].network-policy-fqdn`"/></set><block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/></return></block></block></outcome><outcome value='success'> +<switch test="`$tmp.AnAI.network-policy.network-policy-id`" ><outcome value=''> +<block atomic='true'><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'Failed to query newtork-policy from AnAI where network-policy-fqdn = ' + $preload-data.network-topology-information.network-policy[$i].network-policy-fqdn + '. It is likely that the same network-policy-fqdn points to more than one network-policy objects in AnAI.'`"/></set><block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/></return></block></block></outcome><outcome value='Other'> +<save plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network:relationship-list" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid" > +<parameter name="relationship-list.relationship[0].related-to" value="network-policy" /> +<parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="network-policy.network-policy-id" /> +<parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.AnAI.network-policy.network-policy-id`" /><outcome value='failure'> +<block atomic='true'><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'An error occurred while saving network-policy relationship for l3-network in AnAI where network-policy-id = ' + $tmp.AnAI.network-policy.network-policy-id`"/></set><block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/></return></block></block></outcome><outcome value='not-found'> +<block atomic='true'><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'An error occurred while saving network-policy relationship for l3-network in AnAI where network-policy-id = ' + $tmp.AnAI.network-policy.network-policy-id`"/></set><block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/></return></block></block></outcome></save></outcome></switch></outcome></get-resource></outcome></switch></for><switch test="`$preload-data.network-topology-information.route-table-reference_length`"><outcome value=''><set> +<parameter name='preload-data.network-topology-information.route-table-reference_length' value='0' /> +</set></outcome></switch><for index="i" start="0" end="`$preload-data.network-topology-information.route-table-reference_length`"> +<switch test="`$preload-data.network-topology-information.route-table-reference[$i].route-table-reference-fqdn != ''`"><outcome value='true'> +<get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="route-table-reference" + key="route-table-reference.route-table-reference-fqdn = $preload-data.network-topology-information.route-table-reference[$i].route-table-reference-fqdn" + pfx="tmp.AnAI.route-table-reference"><outcome value='not-found'> +<block atomic='true'><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'Failed to query network-policy n AnAI where network-policy-fqdn = ' + $preload-data.network-topology-information.network-policy[$i].network-policy-fqdn`"/></set></block></outcome><outcome value='failure'> +<block atomic='true'><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'Failed to query network-policy n AnAI where network-policy-fqdn = ' + $preload-data.network-topology-information.network-policy[$i].network-policy-fqdn`"/></set></block></outcome><outcome value='success'> +<switch test="`$tmp.AnAI.route-table-referencey.route-table-reference-id`" ><outcome value=''> +<block atomic='true'><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'Failed to query route-table-reference from AnAI where route-table-reference-fqdn = ' + $preload-data.network-topology-information.route-table-reference[$i].route-table-reference-fqdn + '. It is likely that the same route-table-reference-fqdn points to more than one route-table-reference objects in AnAI.'`"/></set></block></outcome><outcome value='Other'> +<save plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network:relationship-list" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid" > +<parameter name="relationship-list.relationship[0].related-to" value="route-table-reference" /> +<parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="route-table-reference.route-table-reference-id" /> +<parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.AnAI.route-table-reference.route-table-reference-id`" /><outcome value='failure'> +<block atomic='true'><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'An error occurred while saving route-table-reference relationship for l3-network in AnAI where route-table-reference-id = ' + $tmp.AnAI.route-table-reference.route-table-reference-id`"/></set><block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/></return></block></block></outcome><outcome value='not-found'> +<block atomic='true'><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'An error occurred while saving route-table-reference relationship for l3-network in AnAI where route-table-reference-id = ' + $tmp.AnAI.route-table-reference.route-table-reference-id`"/></set><block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/></return></block></block></outcome></save></outcome></switch></outcome></get-resource></outcome></switch></for><switch test="`$tmp.is-bound-to-vpn`"><outcome value="true"><update plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid" > +<parameter name="is-bound-to-vpn" value="true" /><outcome value='failure'> +<block atomic='true'><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'An error occurred while updating l3-network is-bound-to-vpn in AnAI where network-id = ' + $tmp.return.generate-l3network-network-id.uuid`"/></set><block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/></return></block></block></outcome><outcome value='not-found'> +<block atomic='true'><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'An error occurred while updating l3-network is-bound-to-vpn in AnAI where network-id = ' + $tmp.return.generate-l3network-network-id.uuid`"/></set><block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/></return></block></block></outcome></update></outcome></switch><save plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network:relationship-list" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid" > +<parameter name="relationship-list.relationship[0].related-to" value="service-instance" /> +<parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="customer.global-customer-id" /> +<parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$network-topology-operation-input.service-information.subscriber-name`" /> +<parameter name="relationship-list.relationship[0].relationship-data[1].relationship-key" value="service-subscription.service-type" /> +<parameter name="relationship-list.relationship[0].relationship-data[1].relationship-value" value="`$network-topology-operation-input.service-information.service-type`" /> +<parameter name="relationship-list.relationship[0].relationship-data[2].relationship-key" value="service-instance.service-instance-id" /> +<parameter name="relationship-list.relationship[0].relationship-data[2].relationship-value" value="`$network-topology-operation-input.service-information.service-instance-id`" /><outcome value='failure'> +<block atomic='true'><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'An error occurred while saving service-instance relationship for l3-network in AnAI where service-instance-id = ' + $network-topology-operation-input.service-information.service-instance-id`"/></set><block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/></return></block></block></outcome><outcome value='not-found'> +<block atomic='true'><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'An error occurred while saving service-instance relationship for l3-network in AnAI where service-instance-id = ' + $network-topology-operation-input.service-information.service-instance-id`"/></set><block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.return.generate-l3network-network-id.uuid"></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Error writing to l3-netework - ' + $tmp.error-message`"/></return></block></block></outcome></save><set> +<parameter name="ack-final" value="Y"/></set><return status="success"> + <parameter name="networkId" value="`$tmp.return.generate-l3network-network-id.uuid`" /> + <parameter name="error-code" value="200" /></return></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-network-topology-changeassign.xml b/platform-logic/vnfapi/src/main/xml/dg-network-topology-changeassign.xml new file mode 100644 index 00000000..8b16c83a --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-network-topology-changeassign.xml @@ -0,0 +1,525 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc="network-topology-changeassign" mode="sync"><block atomic="true"><get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $network-topology-operation-input.network-request-information.network-id" + local-only="false" + pfx="tmp.AnAI.l3network"> +<outcome value='failure'> +<return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error retrieving l3-network with network-id=' + $network-topology-operation-input.network-request-information.network-id + ' from AnAI'`" /></return></outcome><outcome value='not-found'> +<return status='failure'> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="`'network-id: ' + $network-topology-operation-input.network-request-information.network-id + 'not found in AnAI'`" /></return></outcome></get-resource><switch test="`$tmp.AnAI.l3network.network-name == $network-topology-operation-input.network-request-information.network-name`"><outcome value='false'> +<return status='failure'> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="`'The input network-name,' + network-topology-operation-input.network-request-information.network-name + ', does not match what is returned from AnAI with network-id = ' + $network-topology-operation-input.network-request-information.network-id`" /></return></outcome></switch><switch test="`$tmp.AnAI.l3network.network-type == $network-topology-operation-input.network-request-information.network-type`"><outcome value='false'> +<return status='failure'> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="`'The input network-type,' + network-topology-operation-input.network-request-information.network-type + ', does not match what is returned from AnAI with network-id = ' + $network-topology-operation-input.network-request-information.network-id`" /></return></outcome></switch><switch test="`$tmp.AnAI.l3network.network-name == $preload-data.network-topology-information.network-topology-identifier.network-name`"><outcome value='false'> +<return status='failure'> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="`'No preload network found with network-name = ' + $tmp.AnAI.l3network.network-name + ' in SDNC'`" /></return></outcome></switch><switch test="`$tmp.AnAI.l3network.network-type == $preload-data.network-topology-information.network-topology-identifier.network-type`"><outcome value='false'> +<return status='failure'> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="`'No preload network found with network-type = ' + $tmp.AnAI.l3network.network-type + ' in SDNC'`" /></return></outcome></switch><set> + <parameter name='x' value='0' /> + <parameter name='tmp.error-message' value='' /> + <parameter name='execute_failure' value='false' /> + <parameter name='tmp.l3networkUpdate' value='0' /></set><switch test="`$tmp.AnAI.l3network.subnets.subnet_length`"><outcome value=''><set> +<parameter name="tmp.AnAI.l3network.subnets.subnet_length" value="0" /> +</set></outcome></switch><for index="k" start="0" end="`$tmp.AnAI.l3network.subnets.subnet_length`"> +<block atomic='true'><set> +<parameter name='tmp.start-address-match' value='0' /> +</set><set> +<parameter name='tmp.subnetUpdate' value='0' /> +</set><block atomic='true'><for index="n" start="0" end="`$preload-data.network-topology-information.subnets_length`"> +<switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].network-start-address == $preload-data.network-topology-information.subnets[$n].start-address`"><outcome value='true'> +<block atomic='true'><set> +<parameter name='tmp.start-address-match' value='1' /> +</set><switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].cidr-mask == $preload-data.network-topology-information.subnets[$n].cidr-mask`"><outcome value='false'> +<set> +<parameter name="tmp.subnetUpdate" value="1" /> +</set></outcome></switch><switch test="`$preload-data.network-topology-information.subnets[$n].gateway-address`"><outcome value=''><block> +<execute plugin="org.openecomp.sdnc.sli.plugin.ipAddressTools.IpAddressTool" method="getGatewayAddress"> + <parameter name="ipAddress" value="`$preload-data.network-topology-information.subnets[$n].start-address`" /> + <parameter name="ipVersion" value="`$preload-data.network-topology-information.subnets[$n].ip-version`" /> + <parameter name="subnet" value="`$preload-data.network-topology-information.subnets[$n].cidr-mask`" /> + <parameter name="ctxVariable" value="tmp.return.generate.gateway-address" /></execute><switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].gateway-address == $tmp.return.generate.gateway-address`"><outcome value='false'> +<block> +<set> +<parameter name="tmp.gateway-address" value="`$tmp.return.generate.gateway-address`" /> +</set><set> +<parameter name="tmp.subnetUpdate" value="1" /> +</set></block></outcome></switch></block></outcome><outcome value='Other'> +<switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].gateway-address == $preload-data.network-topology-information.subnets[$n].gateway-address`"><outcome value='false'> +<block> +<set> +<parameter name="tmp.gateway-address" value="`$preload-data.network-topology-information.subnets[$n].gateway-address`" /> +</set><set> +<parameter name="tmp.subnetUpdate" value="1" /> +</set></block></outcome><outcome value='true'> +<set> +<parameter name="tmp.gateway-address" value="`$preload-data.network-topology-information.subnets[$n].gateway-address`" /> +</set></outcome></switch></outcome></switch><switch test="`$preload-data.network-topology-information.subnets[$n].dhcp-enabled`"><outcome value='N'><set> +<parameter name="tmp.dhcpEnabled.boolean" value="false" /> +</set></outcome><outcome value='Y'><set> +<parameter name="tmp.dhcpEnabled.boolean" value="true" /> +</set></outcome></switch><switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].dhcp-enabled == $tmp.dhcpEnabled.boolean`"><outcome value='false'> +<block> +<set> +<parameter name="tmp.subnetUpdate" value="1" /> +</set></block></outcome></switch><switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].dhcp-start == $preload-data.network-topology-information.subnets[$n].dhcp-start-address`"><outcome value='false'> +<block> +<set> +<parameter name="tmp.subnetUpdate" value="1" /> +</set></block></outcome></switch><switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].dhcp-end == $preload-data.network-topology-information.subnets[$n].dhcp-end-address`"><outcome value='false'> +<block> +<set> +<parameter name="tmp.subnetUpdate" value="1" /> +</set></block></outcome></switch><switch test="`$tmp.AnAI.l3network.subnets.subnet[$k].subnet-name == $preload-data.network-topology-information.subnets[$n].subnet-name`"><outcome value='false'> +<block> +<set> +<parameter name="tmp.subnetUpdate" value="1" /> +</set></block></outcome></switch><switch test="`$tmp.subnetUpdate == 1`"><outcome value='true'> +<update plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="subnet" + key="l3-network.network-id = $tmp.AnAI.l3network.network-id + AND subnet.subnet-id = $tmp.AnAI.l3network.subnets.subnet[$k].subnet-id" > + <!-- Update l3network.subnet --> + <parameter name="gateway-address" value="`$tmp.gateway-address`"/> + <parameter name="subnet-name" value="`$preload-data.network-topology-information.subnets[$n].subnet-name`"/> + <parameter name="cidr-mask" value="`$preload-data.network-topology-information.subnets[$n].cidr-mask`"/> + <parameter name="dhcp-start" value="`$preload-data.network-topology-information.subnets[$n].dhcp-start-address`"/> + <parameter name="dhcp-end" value="`$preload-data.network-topology-information.subnets[$n].dhcp-end-address`"/> + <parameter name="dhcp-enabled" value="`$tmp.dhcpEnabled.boolean`"/> + <parameter name="orchestration-status" value="pending-update" /> + <outcome value='failure'> +<block> +<set> + <parameter name='k' value='`$tmp.AnAI.l3network.subnets.subnet_length + 1`' /> + <parameter name='n' value='`$preload-data.network-topology-information.subnets_length + 1`' /></set><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'An error occurred while updating subnet attributes in AnAI with subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$k].subnet-id`"/></set><return status='success'> + <parameter name='execute_failure' value='true' /> +</return></block></outcome><outcome value='not-found'> +<block> +<set> + <parameter name='k' value='`$tmp.AnAI.l3network.subnets.subnet_length + 1`' /> + <parameter name='n' value='`$preload-data.network-topology-information.subnets_length + 1`' /></set><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'An error occurred while updating subnet attributes in AnAI with subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$k].subnet-id`"/></set><return status='success'> + <parameter name='execute_failure' value='true' /> +</return></block></outcome><outcome value='success'> +<block> +<set> + <parameter name="tmp.subnetRollback[$x].subnet-id" value= "`$tmp.AnAI.l3network.subnets.subnet[$k].subnet-id`"/> + <parameter name="tmp.subnetRollback[$x].type" value = "update"/> + + + +</set><set> + <parameter name="x" value = "`$x + 1`" /> + +</set><set> +<parameter name="tmp.l3networkUpdate" value="1" /> +</set></block></outcome></update></outcome></switch></block></outcome></switch></for><switch test="`$execute_failure`"><outcome value='false'> +<switch test="`$tmp.start-address-match == 0`"><outcome value='true'> +<update plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="subnet" + key="l3-network.network-id = $tmp.AnAI.l3network.network-id + AND subnet.subnet-id = $tmp.AnAI.l3network.subnets.subnet[$k].subnet-id" > +<parameter name="orchestration-status" value="pending-delete" /> + <outcome value='failure'> +<block> +<set> + <parameter name='k' value='`$tmp.AnAI.l3network.subnets.subnet_length + 1`' /> + <parameter name='n' value='`$preload-data.network-topology-information.subnets_length + 1`' /></set><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'An error occurred while updating subnet status to pending-delete in AnAI with subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$k].subnet-id`"/></set><return status='success'> + <parameter name='execute_failure' value='true' /> +</return></block></outcome><outcome value='not-found'> +<block> +<set> + <parameter name='k' value='`$tmp.AnAI.l3network.subnets.subnet_length + 1`' /> + <parameter name='n' value='`$preload-data.network-topology-information.subnets_length + 1`' /></set><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'An error occurred while updating subnet status to pending-delete in AnAI with subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$k].subnet-id`"/></set><return status='success'> + <parameter name='execute_failure' value='true' /> +</return></block></outcome><outcome value='success'> +<block> +<set> + <parameter name="tmp.subnetRollback[$x].subnet-id" value= "`$tmp.AnAI.l3network.subnets.subnet[$k].subnet-id`"/> + <parameter name="tmp.subnetRollback[$x].orchestration-status" value= "`$tmp.AnAI.l3network.subnets.subnet[$k].orchestration-status`" /> + <parameter name="tmp.subnetRollback[$x].type" value = "delete" /> + + + +</set><set> + <parameter name="x" value = "`$x + 1`" /> + +</set><set> +<parameter name="tmp.l3networkUpdate" value="1" /> +</set></block></outcome></update></outcome></switch></outcome></switch></block></block></for><switch test="`$execute_failure`"><outcome value='false'> +<for index="i" start="0" end="`$preload-data.network-topology-information.subnets_length`"> +<block atomic='true'><set> +<parameter name="tmp.start-address-match" value="0" /> +</set><block atomic='true'><for index="j" start="0" end="`$tmp.AnAI.l3network.subnets.subnet_length`"> +<switch test="`$preload-data.network-topology-information.subnets[$i].start-address == $tmp.AnAI.l3network.subnets.subnet[$j].network-start-address`"><outcome value='true'> +<set> +<parameter name='tmp.start-address-match' value='1' /> +</set></outcome></switch></for><switch test="`$tmp.start-address-match == 0`"><outcome value='true'> +<block atomic="true"><switch test="`$preload-data.network-topology-information.subnets[$i].dhcp-enabled`"><outcome value='N'><set> +<parameter name="tmp.dhcpEnabled.boolean" value="false" /> +</set></outcome><outcome value='Y'><set> +<parameter name="tmp.dhcpEnabled.boolean" value="true" /> +</set></outcome></switch><set> +<parameter name='tmp.gateway-address' value='`$preload-data.network-topology-information.subnets[$i].gateway-address`' /> +</set><switch test="`$preload-data.network-topology-information.subnets[$i].gateway-address`"><outcome value=''><block> +<execute plugin="org.openecomp.sdnc.sli.plugin.ipAddressTools.IpAddressTool" method="getGatewayAddress"> + <parameter name="ipAddress" value="`$preload-data.network-topology-information.subnets[$i].start-address`" /> + <parameter name="ipVersion" value="`$preload-data.network-topology-information.subnets[$i].ip-version`" /> + <parameter name="subnet" value="`$preload-data.network-topology-information.subnets[$i].cidr-mask`" /> + <parameter name="ctxVariable" value="tmp.return.generate.gateway-address" /></execute><set> +<parameter name="tmp.gateway-address" value="`$tmp.return.generate.gateway-address`" /> +</set></block></outcome></switch><set> +<parameter name="tmp.local.network-id" value="`$tmp.AnAI.l3network.network-id`" /> +</set><call module="VNF-API" rpc="generate-subnets-subnet-id" mode="sync" > +<outcome value='failure'> +<block> +<set> + <parameter name='j' value='`$tmp.AnAI.l3subnet_length + 1`' /> + <parameter name='i' value='`$preload-data.network-topology-information.subnets_length + 1`' /></set><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'An error occurred while saving new subnet in AnAI with subnet-id = ' + $tmp.return.generate-subnets-subnet-id.uuid`"/></set><return status='success'> + <parameter name='execute_failure' value='true' /> +</return></block></outcome></call><save plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="subnet" + key="l3-network.network-id = $tmp.AnAI.l3network.network-id + AND subnet.subnet-id = $tmp.return.generate-subnets-subnet-id.uuid" > + <!-- Create l3-network object --> + <parameter name="network-id" value="`$tmp.AnAI.l3network.network-id`" /> + <parameter name="subnet-id" value="`$tmp.return.generate-subnets-subnet-id.uuid`" /> + <parameter name="gateway-address" value="`$tmp.gateway-address`" /> + <parameter name="subnet-name" value="`$preload-data.network-topology-information.subnets[$i].subnet-name`" /> + <parameter name="network-start-address" value="`$preload-data.network-topology-information.subnets[$i].start-address`" /> + <parameter name="cidr-mask" value="`$preload-data.network-topology-information.subnets[$i].cidr-mask`" /> + <parameter name="ip-version" value="`$preload-data.network-topology-information.subnets[$i].ip-version`" /> + <parameter name="dhcp-start" value="`$preload-data.network-topology-information.subnets[$i].dhcp-start-address`" /> + <parameter name="dhcp-end" value="`$preload-data.network-topology-information.subnets[$i].dhcp-end-address`" /> + <parameter name="dhcp-enabled" value="`$tmp.dhcpEnabled.boolean`" /> + <parameter name="orchestration-status" value="pending-create" /><outcome value='failure'> +<block> +<set> + <parameter name='j' value='`$tmp.AnAI.l3subnet_length + 1`' /> + <parameter name='i' value='`$preload-data.network-topology-information.subnets_length + 1`' /></set><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'An error occurred while saving new subnet in AnAI with subnet-id = ' + $tmp.return.generate-subnets-subnet-id.uuid`"/></set><return status='success'> + <parameter name='execute_failure' value='true' /> +</return></block></outcome><outcome value='not-found'> +<block> +<set> + <parameter name='j' value='`$tmp.AnAI.l3subnet_length + 1`' /> + <parameter name='i' value='`$preload-data.network-topology-information.subnets_length + 1`' /></set><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'An error occurred while saving new subnet in AnAI with subnet-id = ' + $tmp.return.generate-subnets-subnet-id.uuid`"/></set><return status='success'> + <parameter name='execute_failure' value='true' /> +</return></block></outcome><outcome value='success'> +<block> +<set> + <parameter name="tmp.subnetRollback[$x].subnet-id" value= "`$tmp.return.generate-subnets-subnet-id.uuid`" /> + <parameter name="tmp.subnetRollback[$x].type" value = "create" /></set><set> + <parameter name="x" value = "`$x + 1`" /> + +</set><set> +<parameter name='tmp.l3networkUpdate' value='1' /> +</set></block></outcome></save></block></outcome></switch></block></block></for></outcome></switch><switch test="`$execute_failure`"><outcome value='false'> +<block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network:relationship-list" + key="l3-network.network-id = $tmp.AnAI.l3network.network-id + AND related-to = vpn-binding" ><outcome value='failure'> +<block> +<set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="An error occurred while deleting l3-network vpn-binding relationship from AnAI"/></set><return status='success'> + <parameter name='execute_failure' value='true' /> +</return></block></outcome></delete><switch test="`$execute_failure`"><outcome value='false'> +<block atomic='true'><switch test="`$preload-data.network-topology-information.vpn-bindings_length`"><outcome value=''><set> +<parameter name="preload-data.network-topology-information.vpn-bindings_length" value="0" /> +</set></outcome></switch><for index="i" start="0" end="`$preload-data.network-topology-information.vpn-bindings_length`"> +<block atomic='true'><set> +<parameter name="tmp.vpn-binding-id" value="" /> +</set><switch test="`$preload-data.network-topology-information.vpn-bindings[$i].vpn-binding-id`"><outcome value='Other'> +<set> +<parameter name="tmp.vpn-binding-id" value="`$preload-data.network-topology-information.vpn-bindings[$i].vpn-binding-id`" /> +</set></outcome></switch><switch test="`$preload-data.network-topology-information.vpn-bindings[$i].global-route-target != ''`" ><outcome value='true'> +<get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="vpn-binding" + key="vpn-binding.global-route-target = $preload-data.network-topology-information.vpn-bindings[$i].global-route-target" + pfx="tmp.AnAI.vpn-binding"><outcome value='not-found'> +<block><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'Failed to query vpn-bindings n AnAI where global-route-target = ' + $preload-data.network-topology-information.vpn-bindings[$i].global-route-target`"/></set><return status='success'> + <parameter name='execute_failure' value='true' /> +</return></block></outcome><outcome value='failure'> +<block><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'Failed to query vpn-bindings n AnAI where global-route-target = ' + $preload-data.network-topology-information.vpn-bindings[$i].global-route-target`"/></set><return status='success'> + <parameter name='execute_failure' value='true' /> +</return></block></outcome><outcome value='success'> +<set> +<parameter name="tmp.vpn-binding-id" value="`$tmp.AnAI.vpn-binding.vpn-id`" /> +</set></outcome></get-resource></outcome></switch><switch test="`$execute_failure`"><outcome value='false'> +<switch test="`$tmp.vpn-binding-id != ''`"><outcome value='true'> +<save plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network:relationship-list" + key="l3-network.network-id = $tmp.AnAI.l3network.network-id" > +<parameter name="relationship-list.relationship[0].related-to" value="vpn-binding" /> +<parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="vpn-binding.vpn-id" /> +<parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.vpn-binding-id`" /><outcome value='failure'> +<block><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'An error occurred while saving l3-newtork vpn-binding relationship in AnAI where vpn-id = ' + $tmp.vpn-binding-id`"/></set><set> + <parameter name="i" value = "`$preload-data.network-topology-information.vpn-bindings_length + 1`" /> + +</set><return status='success'> + <parameter name='execute_failure' value='true' /> +</return></block></outcome><outcome value='not-found'> +<block><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'An error occurred while saving l3-newtork vpn-binding relationship in AnAI where vpn-id = ' + $tmp.vpn-binding-id`"/></set><set> + <parameter name="i" value = "`$preload-data.network-topology-information.vpn-bindings_length + 1`" /> + +</set><return status='success'> + <parameter name='execute_failure' value='true' /> +</return></block></outcome><outcome value='success'> +<set> +<parameter name='tmp.vpn-binding.updated' value='1' /> +</set></outcome></save></outcome></switch></outcome></switch></block></for></block></outcome></switch></block></outcome></switch><switch test="`$execute_failure`"><outcome value='false'> +<block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network:relationship-list" + key="l3-network.network-id = $tmp.AnAI.l3network.network-id + AND related-to = network-policy" ><outcome value='failure'> +<block> +<set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="An error occurred while deleting l3-network network-policy relationship from AnAI in preparation to regenerate the network-policy relationship from PRELOAD."/></set><return status='success'> + <parameter name='execute_failure' value='true' /> +</return></block></outcome></delete><switch test="`$execute_failure`"><outcome value='false'> +<block atomic='true'><switch test="`$preload-data.network-topology-information.network-policy_length`"><outcome value=''><set> +<parameter name='preload-data.network-topology-information.network-policy_length' value='0' /> +</set></outcome></switch><for index="i" start="0" end="`$preload-data.network-topology-information.network-policy_length`"> +<switch test="`$preload-data.network-topology-information.network-policy[$i].network-policy-fqdn != NULL`"><outcome value='true'> +<get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="network-policy" + key="network-policy.network-policy-fqdn = $preload-data.network-topology-information.network-policy[$i].network-policy-fqdn" + pfx="tmp.AnAI.network-policy" ><outcome value='not-found'> +<block><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'Failed to query network-policy n AnAI where network-policy-fqdn = ' + $preload-data.network-topology-information.network-policy[$i].network-policy-fqdn`"/></set><return status='success'> + <parameter name='execute_failure' value='true' /> +</return></block></outcome><outcome value='failure'> +<block><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'Failed to query network-policy n AnAI where network-policy-fqdn = ' + $preload-data.network-topology-information.network-policy[$i].network-policy-fqdn`"/></set><return status='success'> + <parameter name='execute_failure' value='true' /> +</return></block></outcome><outcome value='success'> +<save plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network:relationship-list" + key="l3-network.network-id = $tmp.AnAI.l3network.network-id" > +<parameter name="relationship-list.relationship[0].related-to" value="network-policy" /> +<parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="network-policy.network-policy-id" /> +<parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.AnAI.network-policy.network-policy-id`" /><outcome value='failure'> +<block><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'An error occurred while saving l3-newtork network-policy relationship in AnAI where network-policy-id = ' + $tmp.AnAI.network-policy.network-policy-id`"/></set><return status='success'> + <parameter name='execute_failure' value='true' /> +</return></block></outcome><outcome value='not-found'> +</outcome><outcome value='success'> +<set> +<parameter name='tmp.network-policy.updated' value='1' /> +</set></outcome></save></outcome></get-resource></outcome></switch></for></block></outcome></switch></block></outcome></switch><switch test="`$execute_failure`"><outcome value='false'> +<block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network:relationship-list" + key="l3-network.network-id = $tmp.AnAI.l3network.network-id + AND related-to = route-table-reference" ><outcome value='failure'> +<block> +<set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="An error occurred while deleting l3-network route-table-reference relationship from AnAI prior to regenerate the route-table-reference relationship from PRELOAD."/></set><return status='success'> + <parameter name='execute_failure' value='true' /> +</return></block></outcome></delete><switch test="`$execute_failure`"><outcome value='false'> +<block atomic='true'><switch test="`$preload-data.network-topology-information.route-table-reference_length`"><outcome value=''><set> +<parameter name='preload-data.network-topology-information.route-table-reference_length' value='0' /> +</set></outcome></switch><for index="i" start="0" end="`$preload-data.network-topology-information.route-table-reference_length`"> +<switch test="`$preload-data.network-topology-information.route-table-reference[$i].route-table-reference-fqdn != NULL`"><outcome value='true'> +<get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="route-table-reference" + key="route-table-reference.route-table-reference-fqdn = $preload-data.network-topology-information.route-table-reference[$i].route-table-reference-fqdn" + pfx="tmp.AnAI.route-table-reference"><outcome value='not-found'> +<block><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'Failed to query network-policy n AnAI where network-policy-fqdn = ' + $preload-data.network-topology-information.network-policy[$i].network-policy-fqdn`"/></set><return status='success'> + <parameter name='execute_failure' value='true' /> +</return></block></outcome><outcome value='failure'> +<block><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'Failed to query network-policy n AnAI where network-policy-fqdn = ' + $preload-data.network-topology-information.network-policy[$i].network-policy-fqdn`"/></set><return status='success'> + <parameter name='execute_failure' value='true' /> +</return></block></outcome><outcome value='success'> +<save plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network:relationship-list" + key="l3-network.network-id = $tmp.AnAI.l3network.network-id" > +<parameter name="relationship-list.relationship[0].related-to" value="route-table-reference" /> +<parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="route-table-reference.route-table-reference-id" /> +<parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.AnAI.route-table-reference.route-table-reference-id`" /><outcome value='failure'> +<block><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="`'An error occurred while saving l3-newtork route-table-reference relationship in AnAI where route-table-reference-id = ' + $tmp.AnAI.route-table-reference.route-table-reference-id`"/></set><return status='success'> + <parameter name='execute_failure' value='true' /> +</return></block></outcome><outcome value='not-found'> +</outcome><outcome value='success'> +<set> +<parameter name='tmp.route-table-reference.updated' value='1' /> +</set></outcome></save></outcome></get-resource></outcome></switch></for></block></outcome></switch></block></outcome></switch><switch test="`$execute_failure`"><outcome value='false'> +<switch test="`$tmp.l3networkUpdate == 1`"> +<outcome value='true'> +<update plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.AnAI.l3network.network-id" > +<parameter name="orchestration-status" value="pending-update" /><outcome value='failure'> +<block><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="An error occurred while updating l3-network.orchestration-status in AnAI"/></set><return status='success'> + <parameter name='execute_failure' value='true' /> +</return></block></outcome><outcome value='not-found'> +<block><set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.error-message" value="An error occurred while updating l3-network.orchestration-status in AnAI"/></set><return status='success'> + <parameter name='execute_failure' value='true' /> +</return></block></outcome><outcome value='success'> +<set> +<parameter name='tmp.l3network.status.updated' value='1' /> +</set></outcome></update></outcome></switch></outcome></switch><switch test="`$execute_failure`"><outcome value="true"><block atomic='true'><for index="z" start="0" end="`$tmp.AnAI.l3network.relationship-list.relationship_length`"> +<switch test="`$tmp.AnAI.l3network.relationship-list.relationship[$z].related-to`"><outcome value='vpn-binding'> +<switch test="`$tmp.vpn-binding.updated == 1`"><outcome value='true'> +<save plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network:relationship-list" + key="l3-network.network-id = $tmp.AnAI.l3network.network-id" > +<parameter name="relationship-list.relationship[0].related-to" value="vpn-binding" /> +<parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="vpn-binding.vpn-id" /> +<parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.AnAI.l3network.relationship-list.relationship[$z].relationship-data[0].relationship-value`" /><outcome value='failure'> +<set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.rollback.error-message" value="`'An error occurred during rollback of l3-newtork vpn-binding relationship in AnAI where vpn-id = ' + $tmp.AnAI.l3network.relationship-list.relationship[$z].relationship-data[0].relationship-value + ' MANUAL ROLLBACK IS REQUIRED.'`"/></set></outcome><outcome value='not-found'> +<set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.rollback.error-message" value="`'An error occurred during rollback of l3-newtork vpn-binding relationship in AnAI where vpn-id = ' + $tmp.AnAI.l3network.relationship-list.relationship[$z].relationship-data[0].relationship-value + ' MANUAL ROLLBACK IS REQUIRED.'`"/></set></outcome></save></outcome></switch></outcome><outcome value='network-policy'> +<switch test="`$tmp.network-policy.updated == 1`"><outcome value='true'> +<save plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network:relationship-list" + key="l3-network.network-id = $tmp.AnAI.l3network.network-id" > +<parameter name="relationship-list.relationship[0].related-to" value="network-policy" /> +<parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="network-policy.network-policy-id" /> +<parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.AnAI.l3network.relationship-list.relationship[$z].relationship-data[0].relationship-value`" /><outcome value='failure'> +<set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.rollback.error-message" value="`'An error occurred during rollback of l3-newtork network-policy relationship in AnAI where network-policy-id = ' + $tmp.AnAI.l3network.relationship-list.relationship[$z].relationship-data[0].relationship-value + ' MANUAL ROLLBACK IS REQUIRED.'`"/></set></outcome><outcome value='not-found'> +<set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.rollback.error-message" value="`'An error occurred during rollback of l3-newtork network-policy relationship in AnAI where network-policy-id = ' + $tmp.AnAI.l3network.relationship-list.relationship[$z].relationship-data[0].relationship-value + ' MANUAL ROLLBACK IS REQUIRED.'`"/></set></outcome></save></outcome></switch></outcome><outcome value='route-table-reference'> +<switch test="`$tmp.route-table-reference.updated == 1`"><outcome value='true'> +<save plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network:relationship-list" + key="l3-network.network-id = $tmp.AnAI.l3network.network-id" > +<parameter name="relationship-list.relationship[0].related-to" value="route-table-reference" /> +<parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="route-table-reference.route-table-reference-id" /> +<parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.AnAI.l3network.relationship-list.relationship[$z].relationship-data[0].relationship-value`" /><outcome value='failure'> +<set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.rollback.error-message" value="`'An error occurred during rollback of l3-newtork route-table-reference relationship in AnAI where route-table-reference-id = ' + $tmp.AnAI.l3network.relationship-list.relationship[$z].relationship-data[0].relationship-value + ' MANUAL ROLLBACK IS REQUIRED.'`"/></set></outcome><outcome value='not-found'> +<set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.rollback.error-message" value="`'An error occurred during rollback of l3-newtork route-table-reference relationship in AnAI where route-table-reference-id = ' + $tmp.AnAI.l3network.relationship-list.relationship[$z].relationship-data[0].relationship-value + ' MANUAL ROLLBACK IS REQUIRED.'`"/></set></outcome></save></outcome></switch></outcome></switch></for><for index="j" start="0" end="`$x`"> +<block atomic='true'><set> + <parameter name="tmp.rollback.match" value="0"/></set><for index="i" start="0" end="`$tmp.AnAI.l3network.subnets.subnet_length`"> +<switch test="`$tmp.AnAI.l3network.subnets.subnet[$i].subnet-id == $tmp.subnetRollback[$j].subnet-id`"><outcome value='true'> +<block atomic='true'><switch test="`$tmp.subnetRollback[$j].type`"><outcome value='delete'> +<update plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="subnet" + key="l3-network.network-id = $tmp.AnAI.l3network.network-id + AND subnet.subnet-id = $tmp.subnetRollback[$j].subnet-id" > +<parameter name="orchestration-status" value="`$tmp.AnAI.l3network.subnets.subnet[$i].orchestration-status`" /> + <outcome value='not-found'> +<set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.rollback.error-message" value="`'failed to rollback the subnet.orchestration-status in AnAI where subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$i].subnet-id + ' MANUAL ROLLBACK IS REQUIRED.'`"/></set></outcome><outcome value='failure'> +<set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.rollback.error-message" value="`'failed to rollback the subnet.orchestration-status in AnAI where subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$i].subnet-id + ' MANUAL ROLLBACK IS REQUIRED.'`"/></set></outcome></update></outcome><outcome value='update'> +<update plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="subnet" + key="l3-network.network-id = $tmp.AnAI.l3network.network-id + AND subnet.subnet-id = $tmp.AnAI.l3network.subnets.subnet[$j].subnet-id" > +<parameter name="subnet-name" value="`$tmp.AnAI.l3network.subnets.subnet[$i].subnet-name`"/> +<parameter name="gateway-address" value="`$tmp.AnAI.l3network.subnets.subnet[$i].gateway-address`"/> +<parameter name="cidr-mask" value="`$tmp.AnAI.l3network.subnets.subnet[$i].cidr-mask`"/> +<parameter name="dhcp-start" value="`$tmp.AnAI.l3network.subnets.subnet[$i].dhcp-start`"/> +<parameter name="dhcp-end" value="`$tmp.AnAI.l3network.subnets.subnet[$i].dhcp-end`"/> +<parameter name="dhcp-enabled" value="`$tmp.AnAI.l3network.subnets.subnet[$i].dhcp-enabled`"/> +<parameter name="orchestration-status" value="`$tmp.AnAI.l3network.subnets.subnet[$i].orchestration-status`" /> + <outcome value='failure'> +<set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.rollback.error-message" value="`'failed to rollback the subnet attributes update in AnAI where subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$i].subnet-id + ' MANUAL ROLLBACK IS REQUIRED.'`"/></set></outcome><outcome value='not-found'> +<set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.rollback.error-message" value="`'failed to rollback the subnet attributes update in AnAI where subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$i].subnet-id + ' MANUAL ROLLBACK IS REQUIRED.'`"/></set></outcome></update></outcome></switch><set> + <parameter name="tmp.rollback.match" value="1"/></set></block></outcome></switch></for><switch test="`$tmp.rollback.match == 0`"><outcome value='true'> +<switch test="`$tmp.subnetRollback[$j].type`"><outcome value='create'> +<delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="subnet" + key="l3-network.network-id = $tmp.AnAI.l3network.network-id + AND subnet.subnet-id = $tmp.subnetRollback[$j].subnet-id" ><outcome value='failure'> +<set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.rollback.error-message" value="`'failed to rollback to delete subnet from AnAI where subnet-id = ' + $tmp.subnetRollback[$j].subnet-id + ' MANUAL ROLLBACK IS REQUIRED.'`"/></set></outcome><outcome value='not-found'> +<set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.rollback.error-message" value="`'failed to rollback to delete subnet from AnAI where subnet-id = ' + $tmp.subnetRollback[$j].subnet-id + ' MANUAL ROLLBACK IS REQUIRED.'`"/></set></outcome></delete></outcome></switch></outcome></switch></block></for><switch test="`$tmp.l3network.status.updated == 1`"> +<outcome value='true'> +<update plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.AnAI.l3network.network-id" > +<parameter name="orchestration-status" value="`$tmp.AnAI.l3network.orchestration-status`" /><outcome value='failure'> +<set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.rollback.error-message" value="`'failed to rollback l3network.orchestration-status in AnAI where subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$i].subnet-id + ' MANUAL ROLLBACK IS REQUIRED.'`"/></set></outcome><outcome value='not-found'> +<set> + <parameter name="error-code" value="500"/> + <parameter name="tmp.rollback.error-message" value="`'failed to rollback l3network.orchestration-status in AnAI where subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$i].subnet-id + ' MANUAL ROLLBACK IS REQUIRED.'`"/></set></outcome></update></outcome></switch><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Error updating l3-network in AnAI with network-id = ' + $tmp.AnAI.l3network.network-id + ' - ' + $tmp.error-message + ' - ' + $tmp.rollback.error-message`"/></return></block></outcome></switch><set> +<parameter name="ack-final" value="Y"/></set><return status="success"> + <parameter name="networkId" value="`$network-topology-operation-input.network-request-information.network-id`" /> + <parameter name="error-code" value="200" /></return></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-network-topology-delete.xml b/platform-logic/vnfapi/src/main/xml/dg-network-topology-delete.xml new file mode 100644 index 00000000..83be0602 --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-network-topology-delete.xml @@ -0,0 +1,75 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc="network-topology-delete" mode="sync"><block atomic="true"> +<switch test="`$network-topology-operation-input.network-request-information.network-id`"><outcome value='Other'><get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $network-topology-operation-input.network-request-information.network-id" + pfx="tmp.AnAI.l3network"> +<outcome value='failure'> +<return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value="Failed to query AAI by network-id"/></return></outcome><outcome value='not-found'> +<return status="success"> + <parameter name="networkId" value="`$network-topology-operation-input.network-request-information.network-id` not found" /> + <parameter name="error-code" value="200" /></return></outcome><outcome value='success'> +<block atomic="true"><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.AnAI.l3network.network-id" ></delete><set> +<parameter name="ack-final" value="Y"/></set><return status='success'> + <parameter name="networkId" value="`$tmp.AnAI.l3network.network-id`" /> + <parameter name="error-code" value="200" /></return></block></outcome></get-resource></outcome><outcome value='0'><switch test="`$network-topology-operation-input.network-request-information.network-name`"><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value="DisconnectNetworkRequest requires network-id or network-name "/></return></outcome><outcome value='Other'><get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-name = $network-topology-operation-input.network-request-information.network-name" + pfx="tmp.AnAI.l3network"> +<outcome value='failure'> +<return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value="Failed to query AAI by network-name"/></return></outcome><outcome value='not-found'> +<return status="success"> + <parameter name="augmentation" value="`$network-topology-operation-input.network-request-information.network-name` not found" /> + <parameter name="error-code" value="200" /></return></outcome><outcome value='success'> +<block atomic="true"><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.AnAI.l3network.network-id" ></delete><set> +<parameter name="ack-final" value="Y"/></set><return status='success'> + <parameter name="networkId" value="`$tmp.AnAI.l3network.network-id`" /> + <parameter name="error-code" value="200" /></return></block></outcome></get-resource></outcome></switch></outcome><outcome value=''><switch test="`$network-topology-operation-input.network-request-information.network-name`"><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value="DisconnectNetworkRequest requires network-id or network-name "/></return></outcome><outcome value='Other'><get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-name = $network-topology-operation-input.network-request-information.network-name" + pfx="tmp.AnAI.l3network"> +<outcome value='failure'> +<return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value="Failed to query AAI by network-name"/></return></outcome><outcome value='not-found'> +<return status="success"> + <parameter name="augmentation" value="`$network-topology-operation-input.network-request-information.network-name` not found" /> + <parameter name="error-code" value="200" /></return></outcome><outcome value='success'> +<block atomic="true"><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $tmp.AnAI.l3network.network-id" ></delete><set> +<parameter name="ack-final" value="Y"/></set><return status='success'> + <parameter name="networkId" value="`$tmp.AnAI.l3network.network-id`" /> + <parameter name="error-code" value="200" /></return></block></outcome></get-resource></outcome></switch></outcome></switch></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-network-topology-operation.xml b/platform-logic/vnfapi/src/main/xml/dg-network-topology-operation.xml new file mode 100644 index 00000000..70c59946 --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-network-topology-operation.xml @@ -0,0 +1,109 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc="network-topology-operation" mode="sync"><block atomic="true"><record plugin="org.openecomp.sdnc.sli.recording.FileRecorder"> +<parameter name="file" value="/opt/opendaylight/current/data/log/svclogic.log"/> +<parameter name="field1" value="__TIMESTAMP__"/> +<parameter name="field2" value="network-topology-operation"/> +<parameter name="field3" value="`$network-topology-operation-input.sdnc-request-header.svc-action`"/> +<parameter name="field4" value="`$network-topology-operation-input.sdnc-request-header.svc-request-id`"/> +<parameter name="field5" value="`$network-topology-operation-input.service-information.service-id`"/> +<parameter name="field6" value="`$network-topology-operation-input.service-information.service-type`"/> +<parameter name="field7" value="`$network-topology-operation-input.service-information.subscriber-name`"/> +<parameter name="field8" value="`$network-topology-operation-input.service-information.service-instance-id`"/> +<parameter name="field9" value="`$network-topology-operation-input.request-information.request-id`"/> +<parameter name="field10" value="`$network-topology-operation-input.request-information.request-action`"/> +<parameter name="field11" value="`$network-topology-operation-input.request-information.source`"/> +<parameter name="field12" value="`$network-topology-operation-input.network-request-information.network-name`"/> +<parameter name="field13" value="`$network-topology-operation-input.network-request-information.network-type`"/> +<parameter name="field14" value="`$network-topology-operation-input.network-request-information.tenant`"/> +<parameter name="field15" value="`$network-topology-operation-input.network-request-information.aic-cloud-region`"/> +<parameter name="field16" value="`$network-topology-operation-input.network-request-information.aic-clli`"/> +<parameter name="field17" value="`$network-topology-operation-input.network-request-information.network-id`"/></record><switch test="`$network-topology-operation-input.request-information.request-action`"> +<outcome value='NetworkActivateRequest'><block atomic="true"> +<switch test="`$network-topology-operation-input.network-request-information.network-name`"><outcome value='Other'><switch test="`$preload-data.network-topology-information.network-topology-identifier.network-name`"><outcome value='Other'><switch test="`$network-topology-operation-input.network-request-information.network-name == $preload-data.network-topology-information.network-topology-identifier.network-name`"><outcome value='false'> +<return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value="`'No preload-data found to match input network-name = ' + $network-topology-operation-input.network-request-information.network-name`"/></return></outcome></switch></outcome><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='network-name not found from preload-data'/></return></outcome></switch></outcome><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='network-name is required from input'/></return></outcome></switch><switch test="`$network-topology-operation-input.network-request-information.network-type`"><outcome value='Other'><switch test="`$preload-data.network-topology-information.network-topology-identifier.network-type`"><outcome value='Other'><switch test="`$network-topology-operation-input.network-request-information.network-type == $preload-data.network-topology-information.network-topology-identifier.network-type`"><outcome value='false'> +<return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value="`'No preload-data found to match input network-type = ' + $network-topology-operation-input.network-request-information.network-type`"/></return></outcome></switch></outcome><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='network-type not found from preload-data'/></return></outcome></switch></outcome><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='network-type is required from input'/></return></outcome></switch><switch test="`$network-topology-operation-input.service-information.service-instance-id`"><outcome value=''><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value='service-instance-id is required.'/></return></outcome></switch><switch test="`$network-topology-operation-input.network-request-information.aic-cloud-region`"><outcome value=''><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value='aic-cloud-region is required.'/></return></outcome></switch><switch test="`$network-topology-operation-input.network-request-information.tenant`"><outcome value=''><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value='tenant is required.'/></return></outcome></switch><switch test="`$network-topology-operation-input.service-information.service-id`"><outcome value=''><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value='service-id is required.'/></return></outcome></switch><switch test="`$network-topology-operation-input.sdnc-request-header.svc-action`"> +<!-- +leaf svc-action { + type enumeration { + enum "reserve"; + enum "assign"; + enum "activate"; // equal to commit + enum "delete"; // equal to commit + enum "changeassign"; + enum "changedelete"; + enum "rollback"; + } +} +--> + +<outcome value='Other'> +<return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='svc-action is not found'/></return></outcome><outcome value='assign'><call module="VNF-API" rpc="network-topology-assign" mode="sync" > +</call></outcome><outcome value='changeassign'><call module="VNF-API" rpc="network-topology-changeassign" mode="sync" > +</call></outcome><outcome value='rollback'><call module="VNF-API" rpc="network-topology-rollback" mode="sync" > +</call></outcome></switch></block></outcome><outcome value='DisconnectNetworkRequest'><switch test="`$network-topology-operation-input.sdnc-request-header.svc-action`"> +<!-- +leaf svc-action { + type enumeration { + enum "reserve"; + enum "assign"; + enum "activate"; // equal to commit + enum "delete"; // equal to commit + enum "changeassign"; + enum "changedelete"; + enum "rollback"; + } +} +--> + +<outcome value='rollback'><call module="VNF-API" rpc="network-topology-rollback" mode="sync" > +</call></outcome><outcome value='delete'><call module="VNF-API" rpc="network-topology-delete" mode="sync" > +</call></outcome><outcome value='Other'> +<return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='svc-action is not found'/></return></outcome></switch></outcome><outcome value="Other"> + +<return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='request-action is not found'/></return></outcome></switch></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-network-topology-rollback.xml b/platform-logic/vnfapi/src/main/xml/dg-network-topology-rollback.xml new file mode 100644 index 00000000..925cac88 --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-network-topology-rollback.xml @@ -0,0 +1,75 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc="network-topology-rollback" mode="sync"><block atomic="true"><get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $network-topology-operation-input.network-request-information.network-id" + pfx="tmp.AnAI.l3network"> +<outcome value='not-found'> +<return status='failure'> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="`'l3-network not found in AnAI with network-id = ' + $network-topology-operation-input.network-request-information.network-id`" /></return></outcome><outcome value='failure'> +<return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'An error occurred while querying l3-network from AnAI with network-id = ' + $network-topology-operation-input.network-request-information.network-id`" /></return></outcome></get-resource><switch test="`$tmp.AnAI.l3network.orchestration-status`"><outcome value='pending-create'> +<delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $network-topology-operation-input.network-request-information.network-id" ><outcome value='failure'> +<return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Failed to delete l3-network from AAI with network-id = ' + $network-topology-operation-input.network-request-information.network-id`"/></return></outcome></delete></outcome><outcome value='pending-delete'> +<update plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $network-topology-operation-input.network-request-information.network-id" > +<parameter name="orchestration-status" value="active" /><outcome value='failure'> +<return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Failed to update l3-netework orchestration-status in AnAI for network-id = ' + $network-topology-operation-input.network-request-information.network-id`"/></return></outcome></update></outcome><outcome value='pending-update'> +<block atomic="true"> +<switch test="`$tmp.AnAI.l3network.subnets.subnet_length`"><outcome value=''><set> +<parameter name="tmp.AnAI.l3network.subnets.subnet_length" value="0" /> +</set></outcome></switch><for index="i" start="0" end="`$tmp.AnAI.l3network.subnets.subnet_length`"> +<switch test="`$tmp.AnAI.l3network.subnets.subnet[$i].orchestration-status`"><outcome value='pending-create'> +<delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="subnet" + key="l3-network.network-id = $network-topology-operation-input.network-request-information.network-id + AND subnet.subnet-id = $tmp.AnAI.l3network.subnets.subnet[$i].subnet-id" ><outcome value='failure'> +<return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Failed to rollback to delete subnet from AnAI with subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$i].subnet-id + ' and network-id = ' + $network-topology-operation-input.network-request-information.network-id`" /></return></outcome></delete></outcome><outcome value='pending-delete'> +<update plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="subnet" + key="l3-network.network-id = $network-topology-operation-input.network-request-information.network-id + AND subnet.subnet-id = $tmp.AnAI.l3network.subnets.subnet[$i].subnet-id" > + <parameter name="orchestration-status" value="active" /> + <outcome value='failure'> +<return status='failure'> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Failed to rollback subnet orchestration-status from AnAI with subnet-id = ' + $tmp.AnAI.l3network.subnets.subnet[$i].subnet-id + ' and network-id = ' + $network-topology-operation-input.network-request-information.network-id`" /></return></outcome></update></outcome></switch></for><update plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $network-topology-operation-input.network-request-information.network-id" > +<parameter name="orchestration-status" value="active" /><outcome value='failure'> +<return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Failed to rollback l3-netework orchestration-status in AnAI for network-id = ' + $network-topology-operation-input.network-request-information.network-id`"/></return></outcome></update></block></outcome></switch><set> +<parameter name="ack-final" value="Y"/></set><return status="success"> + <parameter name="networkId" value="`$network-topology-operation-input.network-request-information.network-id`" /> + <parameter name="error-code" value="200" /></return></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-preload-network-topology-operation.xml b/platform-logic/vnfapi/src/main/xml/dg-preload-network-topology-operation.xml new file mode 100644 index 00000000..52b68e26 --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-preload-network-topology-operation.xml @@ -0,0 +1,55 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc="preload-network-topology-operation" mode="sync"><block atomic="true"><record plugin="org.openecomp.sdnc.sli.recording.FileRecorder"> +<parameter name="file" value="/opt/opendaylight/current/data/log/svclogic.log"/> +<parameter name="field1" value="__TIMESTAMP__"/> +<parameter name="field2" value="preload-network-topology-operation"/> +<parameter name="field3" value="`$preload-network-topology-operation-input.sdnc-request-header.svc-action`"/> +<parameter name="field4" value="`$preload-network-topology-operation-input.sdnc-request-header.svc-request-id`"/> +<parameter name="field5" value="`$preload-network-topology-operation-input.service-information.service-instance-id`"/> +<parameter name="field6" value="`$preload-network-topology-operation-input.request-information.request-id`"/> +<parameter name="field7" value="`$preload-network-topology-operation-input.request-information.request-action`"/> +<parameter name="field8" value="`$preload-network-topology-operation-input.request-information.source`"/> +<parameter name="field9" value="`$preload-network-topology-operation-input.network-topology-information.network-topology-identifier.service-type`"/> +<parameter name="field10" value="`$preload-network-topology-operation-input.network-topology-information.network-topology-identifier.network-name`"/> +<parameter name="field11" value="`$preload-network-topology-operation-input.network-topology-information.network-topology-identifier.network-type`"/> +<parameter name="field12" value="`$preload-network-topology-operation-input.network-topology-information.network-topology-identifier.network-role`"/> +<parameter name="field13" value="`$preload-network-topology-operation-input.network-topology-information.network-topology-identifier.network-technology`"/></record><switch test="`$preload-network-topology-operation-input.request-information.request-action`"> +<outcome value='PreloadNetworkRequest'><block atomic="true"><set> +<parameter name="preload-data." value="" /> +</set><set> +<parameter name="preload-data." value="preload-network-topology-operation-input." /> +</set><set> + <parameter name="preload-data.oper-status.order-status" value="PendingAssignment"/></set><set> +<parameter name="ack-final" value="Y"/></set><return status="success"> + <parameter name="error-code" value="200" /></return></block></outcome><outcome value='DeletePreloadNetworkRequest'><block atomic="true"><set> +<parameter name="preload-data." value="" /> +</set><set> +<parameter name="ack-final" value="Y"/></set><return status="success"> + <parameter name="error-code" value="200" /></return></block></outcome><outcome value="Other"> + + <return status="failure"> + <parameter name='error-code' value='2000'/> + <parameter name='error-message' value='Invalid Request `$preload-network-topology-operation-input.request-information.request-action`'/> + + +</return></outcome></switch></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-preload-vf-module-topology-operation.xml b/platform-logic/vnfapi/src/main/xml/dg-preload-vf-module-topology-operation.xml new file mode 100644 index 00000000..345b5801 --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-preload-vf-module-topology-operation.xml @@ -0,0 +1,63 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc="preload-vf-module-topology-operation" mode="sync"><block atomic="true"><record plugin="org.openecomp.sdnc.sli.recording.FileRecorder"> +<parameter name="file" value="/opt/opendaylight/current/data/log/svclogic.log"/> +<parameter name="field1" value="__TIMESTAMP__"/> +<parameter name="field2" value="preload-vf-module-topology-operation"/> +<parameter name="field3" value="`$preload-vf-module-topology-operation-input.sdnc-request-header.svc-action`"/> +<parameter name="field4" value="`$preload-vf-module-topology-operation-input.sdnc-request-header.svc-request-id`"/> +<parameter name="field5" value="`$preload-vf-module-topology-operation-input.request-information.source`"/> +<parameter name="field6" value="`$preload-vf-module-topology-operation-input.request-information.request-id`"/> +<parameter name="field7" value="`$preload-vf-module-topology-operation-input.request-information.request-action`"/> +<parameter name="field8" value="`$preload-vf-module-topology-operation-input.vf-module-topology-information.vf-module-identifiers.vf-module-model-id`"/> +<parameter name="field9" value="`$preload-vf-module-topology-operation-input.vf-module-topology-information.vf-module-identifiers.vf-module-name`"/> +<parameter name="field10" value="`$preload-vf-module-topology-operation-input.service-information.service-instance-id`"/></record><switch test="`$preload-vf-module-topology-operation-input.request-information.request-action`"> + +<outcome value='PreloadVfModuleRequest'><block atomic="true"><get-resource plugin="org.openecomp.sdnc.sli.resource.sql.SqlResource" + resource="vnf-profile" key="SELECT * from VNF_PROFILE where vnf_type = $preload-vf-module-topology-operation-input.vf-module-topology-information.vf-module-identifiers.vf-module-model-id"> +<outcome value='not-found'> +<return status='failure'> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="preload vnf-model-id not found. New vnf-model-id can be added via admin portal" /></return></outcome><outcome value='failure'> +<return status='failure'> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="preload vnf-model-id not found. New vnf-model-id can be added via admin portal" /></return></outcome></get-resource><set> +<parameter name="vf-module-preload-data." value="" /> +</set><set> +<parameter name="vf-module-preload-data." value="preload-vf-module-topology-operation-input." /> +</set><set> + <parameter name="vf-module-preload-data.oper-status.order-status" value="PendingAssignment"/></set><block> +<set> +<parameter name="ack-final" value="Y"/></set><return status="success"> + <parameter name="error-code" value="200" /></return></block></block></outcome><outcome value='DeletePreloadVfModuleRequest'><block atomic="true"><set> +<parameter name="vf-module-preload-data." value="" /> +</set><block> +<set> +<parameter name="ack-final" value="Y"/></set><return status="success"> + <parameter name="error-code" value="200" /></return></block></block></outcome><outcome value="Other"> + + <return status="failure"> + <parameter name='error-code' value='2000'/> + <parameter name='error-message' value="`'Invalid Request, ' + $preload-vf-module-topology-operation-input.request-information.request-action`"/> + + +</return></outcome></switch></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-preload-vnf-instance-topology-operation.xml b/platform-logic/vnfapi/src/main/xml/dg-preload-vnf-instance-topology-operation.xml new file mode 100644 index 00000000..cec38480 --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-preload-vnf-instance-topology-operation.xml @@ -0,0 +1,63 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc="preload-vnf-instance-topology-operation" mode="sync"><block atomic="true"><record plugin="org.openecomp.sdnc.sli.recording.FileRecorder"> +<parameter name="file" value="/opt/opendaylight/current/data/log/svclogic.log"/> +<parameter name="field1" value="__TIMESTAMP__"/> +<parameter name="field2" value="preload-vnf-instance-topology-operation"/> +<parameter name="field3" value="`$preload-vnf-instance-topology-operation-input.sdnc-request-header.svc-action`"/> +<parameter name="field4" value="`$preload-vnf-instance-topology-operation-input.sdnc-request-header.svc-request-id`"/> +<parameter name="field5" value="`$preload-vnf-instance-topology-operation-input.request-information.source`"/> +<parameter name="field6" value="`$preload-vnf-instance-topology-operation-input.request-information.request-id`"/> +<parameter name="field7" value="`$preload-vnf-instance-topology-operation-input.request-information.request-action`"/> +<parameter name="field8" value="`$preload-vnf-instance-topology-operation-input.vnf-instance-topology-information.vnf-instance-identifiers.vnf-model-id`"/> +<parameter name="field9" value="`$preload-vnf-instance-topology-operation-input.vnf-instance-topology-information.vnf-instance-identifiers.vnf-instance-name`"/> +<parameter name="field10" value="`$preload-vnf-instance-topology-operation-input.service-information.service-instance-id`"/></record><switch test="`$preload-vnf-instance-topology-operation-input.request-information.request-action`"> + +<outcome value='PreloadVnfInstanceRequest'><block atomic="true"><get-resource plugin="org.openecomp.sdnc.sli.resource.sql.SqlResource" + resource="vnf-profile" key="SELECT * from VNF_PROFILE where vnf_type = $preload-vnf-instance-topology-operation-input.vnf-instance-topology-information.vnf-instance-identifiers.vnf-model-id"> +<outcome value='not-found'> +<return status='failure'> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="preload vnf-model-id not found. New vnf-model-id can be added via admin portal" /></return></outcome><outcome value='failure'> +<return status='failure'> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="preload vnf-model-id not found. New vnf-model-id can be added via admin portal" /></return></outcome></get-resource><set> +<parameter name="vnf-instance-preload-data." value="" /> +</set><set> +<parameter name="vnf-instance-preload-data." value="preload-vnf-instance-topology-operation-input." /> +</set><set> + <parameter name="vnf-instance-preload-data.oper-status.order-status" value="PendingAssignment"/></set><block> +<set> +<parameter name="ack-final" value="Y"/></set><return status="success"> + <parameter name="error-code" value="200" /></return></block></block></outcome><outcome value='DeletePreloadVnfInstanceRequest'><block atomic="true"><set> +<parameter name="vnf-instance-preload-data." value="" /> +</set><block> +<set> +<parameter name="ack-final" value="Y"/></set><return status="success"> + <parameter name="error-code" value="200" /></return></block></block></outcome><outcome value="Other"> + + <return status="failure"> + <parameter name='error-code' value='2000'/> + <parameter name='error-message' value='Invalid Request `$preload-vnf-instance-topology-operation-input.request-information.request-action`'/> + + +</return></outcome></switch></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-preload-vnf-topology-operation.xml b/platform-logic/vnfapi/src/main/xml/dg-preload-vnf-topology-operation.xml new file mode 100644 index 00000000..f4274520 --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-preload-vnf-topology-operation.xml @@ -0,0 +1,76 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc="preload-vnf-topology-operation" mode="sync"><block atomic="true"><record plugin="org.openecomp.sdnc.sli.recording.FileRecorder"> +<parameter name="file" value="/opt/opendaylight/current/data/log/svclogic.log"/> +<parameter name="field1" value="__TIMESTAMP__"/> +<parameter name="field2" value="preload-vnf-topology-operation"/> +<parameter name="field3" value="`$preload-vnf-topology-operation-input.sdnc-request-header.svc-action`"/> +<parameter name="field4" value="`$preload-vnf-topology-operation-input.sdnc-request-header.svc-request-id`"/> +<parameter name="field5" value="`$preload-vnf-topology-operation-input.service-information.service-instance-id`"/> +<parameter name="field6" value="`$preload-vnf-topology-operation-input.request-information.request-id`"/> +<parameter name="field7" value="`$preload-vnf-topology-operation-input.request-information.request-action`"/> +<parameter name="field8" value="`$preload-vnf-topology-operation-input.request-information.source`"/> +<parameter name="field9" value="`$preload-vnf-topology-operation-input.vnf-topology-information.vnf-topology-identifier.service-type`"/> +<parameter name="field10" value="`$preload-vnf-topology-operation-input.vnf-topology-information.vnf-topology-identifier.vnf-name`"/> +<parameter name="field11" value="`$preload-vnf-topology-operation-input.vnf-topology-information.vnf-topology-identifier.vnf-type`"/></record><switch test="`$preload-vnf-topology-operation-input.request-information.request-action`"> +<!-- +leaf request-action { + type enumeration { + enum "VNFActivateRequest"; + enum "ChangeVNFActivateRequest"; + enum "DisconnectVNFRequest"; + enum "PreloadVNFRequest"; + enum "DeletePreloadVNFRequest"; + } +} +--> + +<outcome value='PreloadVNFRequest'><block atomic="true"><set> +<parameter name="ack-final" value="Y"/></set><set only-if-unset="true"> +<parameter name="sql-resource-plugin" value="org.openecomp.sdnc.sli.resource.sql.SqlResource"/></set><get-resource plugin="`$sql-resource-plugin`" resource="vnf-profile" key="SELECT * from VNF_PROFILE WHERE vnf_type = $preload-vnf-topology-operation-input.vnf-topology-information.vnf-topology-identifier.vnf-type"> +<outcome value='not-found'> +<return status='failure'> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="preload vnf-type not found as valid vnf " /></return></outcome><outcome value='failure'> +<return status='failure'> + <parameter name="error-code" value="404" /> + <parameter name="error-message" value="preload vnf-type not found as valid vnf " /></return></outcome></get-resource><set> +<parameter name="preload-data." value="" /> +</set><set> +<parameter name="preload-data." value="preload-vnf-topology-operation-input." /> +</set><set> + <parameter name="preload-data.oper-status.order-status" value="PendingAssignment"/></set><return status="success"> + <parameter name="error-code" value="200" /></return></block></outcome><outcome value='DeletePreloadVNFRequest'><block atomic="true"><get-resource plugin="`$sql-resource-plugin`" resource="generic-vnf" key="SELECT * FROM VNF_PROFILE vnf-type = $preload-vnf-topology-operation-input.vnf-topology-information.vnf-topology-identifier.vnf-type"> +<outcome value='success'> +<return status='failure'> + <parameter name="error-code" value="3000" /> + <parameter name="error-message" value="preload vnf-type cannot be deleted while vnf is in use" /></return></outcome></get-resource><set> +<parameter name="preload-data." value="" /> +</set><return status="success"> + <parameter name="error-code" value="200" /></return></block></outcome><outcome value="Other"> + + <return status="failure"> + <parameter name='error-code' value='2000'/> + <parameter name='error-message' value='Invalid Request `$preload-vnf-topology-operation-input.request-information.request-action`'/> + + +</return></outcome></switch></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-vf-module-topology-activate.xml b/platform-logic/vnfapi/src/main/xml/dg-vf-module-topology-activate.xml new file mode 100644 index 00000000..16d92529 --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-vf-module-topology-activate.xml @@ -0,0 +1,45 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc='vf-module-topology-activate' mode='sync'> +<block atomic="true"><switch test="`$vf-module-topology-operation-input.vf-module-request-information.vf-module-id == $vf-module-service-data.vf-module-id`"><outcome value='false'> +<return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value="`'vf-module-id = ' + $vf-module-topology-operation-input.vf-module-request-information.vf-module-id + ' not found in SDNC'`"/></return></outcome></switch><switch test="`$vf-module-service-data.oper-status.order-status == PendingCreate`"><outcome value='false'><switch test="`$vf-module-service-data.oper-status.order-status == PendingUpdate`"><outcome value='false'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='Invalid order-status'/></return></outcome></switch></outcome></switch><set> + <parameter name="vf-module-service-data.oper-status.last-order-status" value="`$vf-module-service-data.oper-status.order-status`"/></set><set> + <parameter name="vf-module-service-data.oper-status.order-status" value="Active"/></set><set> + <parameter name="vf-module-service-data.oper-status.last-action" value="`$vf-module-service-data.request-information.request-action`"/></set><update plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="vf-module" + key="vf-module.vf-module-id = $vf-module-topology-operation-input.vf-module-request-information.vf-module-id + AND generic-vnf.vnf-id = $vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id" > + <parameter name="orchestration-status" value="active" /><outcome value='failure'> +<return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'An error occurred while updating vf-module orchestration-status in AnAI with vf-module-id = ' + $vf-module-topology-operation-input.vf-module-request-information.vf-module-id + ' and vnf-instance-id = ' + $vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id`"/></return></outcome><outcome value='not-found'> +<return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'An error occurred while updating vf-module orchestration-status in AnAI with vf-module-id = ' + $vf-module-topology-operation-input.vf-module-request-information.vf-module-id + ' and vnf-instance-id = ' + $vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id`"/></return></outcome></update><set> + <parameter name="vf-module-service-data." value="vf-module-topology-operation-input." /></set><switch test="`$vnf-instance-service-data.vf-module-relationship-list_length`"><outcome value=''><set> + <parameter name="vnf-instance-service-data.vf-module-relationship-list_length" value="0" /></set></outcome></switch><set> + <parameter name="vnf-instance-service-data.vf-module-relationship-list[$vnf-instance-service-data.vf-module-relationship-list_length].vf-module-id" value="`$vf-module-topology-operation-input.vf-module-request-information.vf-module-id`" /></set><return status='success'> + <parameter name="error-code" value="200" /></return></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-vf-module-topology-assign-vnf-networks.xml b/platform-logic/vnfapi/src/main/xml/dg-vf-module-topology-assign-vnf-networks.xml new file mode 100644 index 00000000..dd2bf239 --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-vf-module-topology-assign-vnf-networks.xml @@ -0,0 +1,129 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc='vf-module-topology-assign-vnf-networks' mode='sync'><block atomic="true"><switch test="`$vf-module-preload-data.oper-status.order-status == PendingAssignment`"><outcome value='false'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='Invalid preload-data order status'/></return></outcome></switch><set> + <parameter name="vf-module-service-data." value="vf-module-preload-data." /></set><set> + <parameter name="vf-module-service-data." value="vf-module-topology-operation-input." /></set><set> + <parameter name="vf-module-service-data.vf-module-id" value="`$vf-module-topology-operation-input.vf-module-request-information.vf-module-id`"/></set><switch test="`$vf-module-preload-data.vf-module-topology-information.vnf-assignments.vnf-networks_length`"><outcome value=''><set> +<parameter name = "vf-module-preload-data.vf-module-topology-information.vnf-assignments.vnf-networks_length" value="0" /> +</set></outcome></switch><for index="j" start="0" end="`$vf-module-preload-data.vf-module-topology-information.vnf-assignments.vnf-networks_length`"><block atomic="true"> +<set> +<parameter name='tmp.usePreload' value='1' /> +<parameter name='tmp.AnAI.l3network.' value='' /> +</set><switch test="`$vf-module-topology-operation-input.vf-module-request-information.vnf-networks_length`"><outcome value=''><set> +<parameter name='vf-module-topology-operation-input.vf-module-request-information.vnf-networks_length' value='0' /> +</set></outcome></switch><block atomic="true"> +<for index="i" start="0" end="`$vf-module-topology-operation-input.vf-module-request-information.vnf-networks_length`"><switch test="`$vf-module-preload-data.vf-module-topology-information.vnf-assignments.vnf-networks[$j].network-role == $vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].network-role`"><outcome value='true'> +<block atomic="true"> +<set> +<parameter name='tmp.usePreload' value='0' /> +</set><switch test="`$vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].network-id == '' or $vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].network-id == '0'`"><outcome value='false'><get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].network-id" + pfx="tmp.AnAI.l3network"> +<outcome value='failure'> +<return status='failure'> +<parameter name='error-code' value='500' /> +<parameter name='error-message' value="`'An error occurred while querying AnAI for l3-network with network-id = ' + $vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].network-id`" /> +</return></outcome><outcome value='not-found'> +<set> +<parameter name='tmp.usePreload' value='1' /> +</set></outcome></get-resource></outcome><outcome value='true'> +<switch test="`$vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].network-name == '' or $vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].network-name == '0'`"><outcome value='true'> +<set> +<parameter name='tmp.usePreload' value='1' /> +</set></outcome><outcome value='false'><get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-name = $vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].network-name" + pfx="tmp.AnAI.l3network"> + +<outcome value='failure'> +<return status='failure'> +<parameter name='error-code' value='500' /> +<parameter name='error-message' value="`'An error occurred whie querying AnAI for l3-network with network-name = ' + $vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].network-name`" /> +</return></outcome><outcome value='not-found'> +<set> +<parameter name='tmp.usePreload' value='1' /> +</set></outcome></get-resource></outcome></switch></outcome></switch><switch test="`$tmp.usePreload == 0`"><outcome value='true'> +<block> +<switch test="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks_length`"><outcome value=''> +<set> + <parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks_length" value = "0" /></set></outcome></switch><for index="k" start="0" end="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks_length`"><switch test="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].network-role == $vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].network-role`"><outcome value='true'> +<block> +<set> +<parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].network-name" value="`$tmp.AnAI.l3network.network-name`" /> +<parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].network-id" value="`$tmp.AnAI.l3network.network-id`" /> +<parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].neutron-id" value="`$tmp.AnAI.l3network.neutron-network-id`" /> +<parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].contrail-network-fqdn" value="`$tmp.AnAI.l3network.contrail-network-fqdn`" /> +</set><switch test="`$vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].subnet-id != ''`"><outcome value='true'> +<set> +<parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].subnet-id" value="`$vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].subnet-id`" /></set></outcome><outcome value='false'> +<switch test="`$vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].subnet-name != ''`"><outcome value='true'> +<switch test="`$tmp.AnAI.l3network.subnets.subnet_length != ''`"><outcome value='true'> +<for index="i" start="0" end="`$tmp.AnAI.l3network.subnets.subnet_length`"><switch test="`$tmp.AnAI.l3network.subnets.subnet[$i].subnet-name == $vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].subnet-name`"><outcome value='true'> +<set> +<parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].subnet-id" value="`$tmp.AnAI.l3network.subnets.subnet[$i].neutron-subnet-id`" /></set></outcome></switch></for></outcome></switch></outcome></switch></outcome></switch><switch test="`$vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].ipv6-subnet-id != ''`"><outcome value='true'> +<set> +<parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].ipv6-subnet-id" value="`$vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].ipv6-subnet-id`" /></set></outcome><outcome value='false'> +<switch test="`$vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].ipv6-subnet-name != ''`"><outcome value='true'> +<switch test="`$tmp.AnAI.l3network.subnets.subnet_length != ''`"><outcome value='true'> +<for index="i" start="0" end="`$tmp.AnAI.l3network.subnets.subnet_length`"><switch test="`$tmp.AnAI.l3network.subnets.subnet[$i].subnet-name == $vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$i].ipv6-subnet-name`"><outcome value='true'> +<set> +<parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].ipv6-subnet-id" value="`$tmp.AnAI.l3network.subnets.subnet[$i].neutron-subnet-id`" /></set></outcome></switch></for></outcome></switch></outcome></switch></outcome></switch></block></outcome></switch></for></block></outcome></switch></block></outcome></switch></for><switch test="`$tmp.usePreload == 1`"><outcome value='true'><block atomic="true"> +<get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-name = $vf-module-preload-data.vf-module-topology-information.vnf-assignments.vnf-networks[$j].network-name" + pfx="tmp.AnAI.l3network"> +<outcome value='not-found'> +<return status='failure'> +<parameter name='error-code' value='500' /> +<parameter name='error-message' value="`'PRELOAD network-name = ' + $vf-module-preload-data.vf-module-topology-information.vnf-assignments.vnf-networks[$j].network-name + ' not found in AnAI'`" /> +</return></outcome><outcome value='failure'> +<return status='failure'> +<parameter name='error-code' value='500' /> +<parameter name='error-message' value="`'An error occurred while querying AnAI for l3-network with network-name = ' + $vf-module-topology-operation-input.vf-module-request-information.vnf-networks[$j].network-name`" /> +</return></outcome><outcome value='success'> +<switch test="`$tmp.AnAI.l3network.network-id == ''`"><outcome value='true'><return status='failure'> +<parameter name='error-code' value='500' /> +<parameter name='error-message' value="`'An error occurred while querying l3-network with network-name = ' + $vf-module-preload-data.vf-module-topology-information.vnf-assignments.vnf-networks[$j].network-name + ' , it is likely that there are more than one l3-newtork object with the same network-name in AnAI.'`" /> +</return></outcome></switch></outcome></get-resource><switch test="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks_length`"><outcome value=''> +<set> + <parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks_length" value = "0" /></set></outcome></switch><for index="k" start="0" end="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks_length`"><switch test="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].network-role == $vf-module-preload-data.vf-module-topology-information.vnf-assignments.vnf-networks[$j].network-role`"><outcome value='true'> +<block><set> +<parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].network-name" value="`$tmp.AnAI.l3network.network-name`" /> +<parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].network-id" value="`$tmp.AnAI.l3network.network-id`" /> +<parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].neutron-id" value="`$tmp.AnAI.l3network.neutron-network-id`" /> +<parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].contrail-network-fqdn" value="`$tmp.AnAI.l3network.contrail-network-fqdn`" /> + +</set><switch test="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].subnet-id == ''`"><outcome value='true'> +<switch test="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].subnet-name != ''`"><outcome value='true'> +<switch test="`$tmp.AnAI.l3network.subnets.subnet_length != ''`"><outcome value='true'> +<for index="i" start="0" end="`$tmp.AnAI.l3network.subnets.subnet_length`"><switch test="`$tmp.AnAI.l3network.subnets.subnet[$i].subnet-name == $vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].subnet-name`"><outcome value='true'> +<set> +<parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].subnet-id" value="`$tmp.AnAI.l3network.subnets.subnet[$i].neutron-subnet-id`" /></set></outcome></switch></for></outcome></switch></outcome></switch></outcome></switch><switch test="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].ipv6-subnet-id == ''`"><outcome value='true'> +<switch test="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].ipv6-subnet-name != ''`"><outcome value='true'> +<switch test="`$tmp.AnAI.l3network.subnets.subnet_length != ''`"><outcome value='true'> +<for index="i" start="0" end="`$tmp.AnAI.l3network.subnets.subnet_length`"><switch test="`$tmp.AnAI.l3network.subnets.subnet[$i].subnet-name == $vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].ipv6-subnet-name`"><outcome value='true'> +<set> +<parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$k].ipv6-subnet-id" value="`$tmp.AnAI.l3network.subnets.subnet[$i].neutron-subnet-id`" /></set></outcome></switch></for></outcome></switch></outcome></switch></outcome></switch></block></outcome></switch></for></block></outcome></switch></block></block></for><return status='success'> + <parameter name="error-code" value="200" /></return></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-vf-module-topology-assign.xml b/platform-logic/vnfapi/src/main/xml/dg-vf-module-topology-assign.xml new file mode 100644 index 00000000..abbb56ad --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-vf-module-topology-assign.xml @@ -0,0 +1,63 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc='vf-module-topology-assign' mode='sync'> +<block atomic="true"><get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="vf-module" + key="vf-module.vf-module-id = $vf-module-topology-operation-input.vf-module-request-information.vf-module-id + and generic-vnf.vnf-id = $vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id" + pfx="tmp.AnAI.vfmodule" ><outcome value='failure'> +<return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'An error occurred while querying vf-module from AnAI with vf-module-id = ' + $vf-module-topology-operation-input.vf-module-request-information.vf-module-id + ' and vnf-instance-id = ' + vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id`"/></return></outcome><outcome value='not-found'> +<return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'vf-module not found in AnAI with vf-module-id = ' + $vf-module-topology-operation-input.vf-module-request-information.vf-module-id + ' and vnf-instance-id = ' + $vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id`"/></return></outcome></get-resource><call module='VNF-API' rpc='vf-module-topology-assign-vnf-networks' mode='sync' ></call><switch test="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks_length`"><outcome value=''><set> +<parameter name='vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks_length' value='0' /> +</set></outcome></switch><for index="i" start="0" end="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks_length`"><save plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="vf-module:relationship-list" + key="vf-module.vf-module-id = $vf-module-topology-operation-input.vf-module-request-information.vf-module-id + and generic-vnf.vnf-id = $vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id" > + <parameter name="relationship-list.relationship[0].related-to" value="l3-network" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="l3-network.network-id" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$i].network-id`" /><outcome value='failure'> +<block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="vf-module:relationship-list" + key="vf-module.vf-module-id = $vf-module-topology-operation-input.vf-module-request-information.vf-module-id + AND generic-vnf.vnf-id = $vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id + AND related-to = l3-network" ></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'An error occurred while saving vf-module l3-network relationship in AnAI with network-id = ' + $vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$i].network-id`"/></return></block></outcome></save></for><update plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="vf-module" + key="vf-module.vf-module-id = $vf-module-topology-operation-input.vf-module-request-information.vf-module-id + and generic-vnf.vnf-id = $vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id" > +<parameter name="orchestration-status" value="pending-create" /><outcome value='failure'> +<block atomic="true"> +<delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="vf-module:relationship-list" + key="vf-module.vf-module-id = $vf-module-topology-operation-input.vf-module-request-information.vf-module-id + AND generic-vnf.vnf-id = $vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id + AND related-to = l3-network" ></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="An error occurred while updating vf-module orchestration-status in AnAI"/></return></block></outcome></update><set> + <parameter name="vf-module-service-data.oper-status.order-status" value="PendingCreate"/></set><set> +<parameter name="ack-final" value="Y"/></set><return status='success'> + <parameter name="error-code" value="200" /></return></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-vf-module-topology-changeassign.xml b/platform-logic/vnfapi/src/main/xml/dg-vf-module-topology-changeassign.xml new file mode 100644 index 00000000..bef4a8db --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-vf-module-topology-changeassign.xml @@ -0,0 +1,85 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc='vf-module-topology-changeassign' mode='sync'> +<block atomic="true"><switch test="`$vf-module-service-data.oper-status.order-status == Active`"><outcome value='false'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='Invalid service-data order status'/></return></outcome></switch><call module='VNF-API' rpc='vf-module-topology-assign-vnf-networks' mode='sync' ></call><get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="vf-module" + key="vf-module.vf-module-id = $vf-module-topology-operation-input.vf-module-request-information.vf-module-id + and generic-vnf.vnf-id = $vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id" + pfx="tmp.AnAI.vfmodule"><outcome value='failure'> +<return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'An error occurred while querying vf-module from AnAI with vf-module-id = ' + $vf-module-topology-operation-input.vf-module-request-information.vf-module-id + ' and vnf-instance-id = ' + $vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id`"/></return></outcome><outcome value='not-found'> +<return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'An error occurred while querying vf-module from AnAI with vf-module-id = ' + $vf-module-topology-operation-input.vf-module-request-information.vf-module-id + ' and vnf-instance-id = ' + $vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id`"/></return></outcome></get-resource><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="vf-module:relationship-list" + key="vf-module.vf-module-id = $vf-module-topology-operation-input.vf-module-request-information.vf-module-id + AND generic-vnf.vnf-id = $vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id + AND related-to = l3-network" ><outcome value='failure'> +<return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'An error occurred while deleting existing vf-module l3-network relationship in AnAI with with vf-module-id = ' + $vf-module-topology-operation-input.vf-module-request-information.vf-module-id + ' and vnf-instance-id = ' + $vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id + ' vf-module update FAILED.'`"/></return></outcome></delete><switch test="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks_length`"><outcome value=''> +<set> + <parameter name="vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks_length" value = "0" /></set></outcome></switch><for index="i" start="0" end="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks_length`"><save plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="vf-module:relationship-list" + key="vf-module.vf-module-id = $vf-module-topology-operation-input.vf-module-request-information.vf-module-id + AND generic-vnf.vnf-id = $vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id" > + + <parameter name="relationship-list.relationship[0].related-to" value="l3-network" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="l3-network.network-id" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$i].network-id`" /><outcome value='failure'> +<block atomic='true'><set> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`' | An error occurred while saving l3-network relationship with network-id = ' + $vf-module-service-data.vf-module-topology-information.vnf-assignments.vnf-networks[$i].network-id + ' for vf-module with vf-module-id = ' + $vf-module-topology-operation-input.vf-module-request-information.vf-module-id + ' and generic-vnf-id = ' + $vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id`" /> +</set><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="vf-module:relationship-list" + key="vf-module.vf-module-id = $vf-module-topology-operation-input.vf-module-request-information.vf-module-id + AND generic-vnf.vnf-id = $vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id + AND related-to = l3-network" ></delete><switch test="`$tmp.AnAI.vfmodule.relationship-list.relationship_length`"><outcome value=''> +<set> + <parameter name="tmp.AnAI.vfmodule.relationship-list.relationship_length" value = "0" /></set></outcome></switch><for index="i" start="0" end="`$tmp.AnAI.vfmodule.relationship-list.relationship_length`"><switch test="`$tmp.AnAI.vfmodule.relationship-list.relationship[$i].related-to`"><outcome value='l3-network'><block atomic='true'><switch test="`$tmp.AnAI.vfmodule.relationship-list.relationship[$i].relationship-data_length`"><outcome value=''> +<set> + <parameter name="tmp.AnAI.vfmodule.relationship-list.relationship[$i].relationship-data_length" value = "0" /></set></outcome></switch><for index="j" start="0" end="`$tmp.AnAI.vfmodule.relationship-list.relationship[$i].relationship-data_length`"><save plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="vf-module:relationship-list" + key="vf-module.vf-module-id = vf-module-topology-operation-input.vf-module-request-information.vf-module-id + AND generic-vnf.vnf-id = $vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id" > + + <parameter name="relationship-list.relationship[0].related-to" value="l3-network" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="l3-network.network-id" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.AnAI.vfmodule.relationship-list.relationship[$i].relationship-data[$j].relationship-value`" /><outcome value='failure'> +<set> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$error-message + ' | An error occurred while during rollback of l3-network relationship for vf-module with vf-module-id = ' + $vf-module-topology-operation-input.vf-module-request-information.vf-module-id + ' and generic-vnf-id = ' + $vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id`" /> +</set></outcome><outcome value='not-found'> +<set> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$error-message + ' | An error occurred while during rollback of l3-network relationship for vf-module with vf-module-id = ' + $vf-module-topology-operation-input.vf-module-request-information.vf-module-id + ' and generic-vnf-id = ' + $vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id`" /> +</set></outcome></save></for></block></outcome></switch></for><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Failed to update vf-module l3-network relationship in AnAI. ' + $error-message`"/></return></block></outcome></save></for><set> + <parameter name="vf-module-service-data.oper-status.last-order-status" value="`$vf-module-service-data.oper-status.order-status`"/></set><set> + <parameter name="vf-module-service-data.oper-status.order-status" value="PendingUpdate"/></set><set> + <parameter name="vf-module-service-data.oper-status.last-action" value="`$vf-module-service-data.request-information.request-action`"/></set><set> +<parameter name="ack-final" value="Y"/></set><return status='success'> + <parameter name="error-code" value="200" /></return></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-vf-module-topology-delete.xml b/platform-logic/vnfapi/src/main/xml/dg-vf-module-topology-delete.xml new file mode 100644 index 00000000..e8c1f431 --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-vf-module-topology-delete.xml @@ -0,0 +1,35 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc='vf-module-topology-delete' mode='sync'> +<block atomic="true"><switch test="`$vf-module-topology-operation-input.vf-module-request-information.vf-module-id == $vf-module-service-data.vf-module-id`"><outcome value='false'> +<return status='failure'> + <parameter name='error-code' value='404'/> + <parameter name='error-message' value='vf-module-id not found in SDNC'/></return></outcome></switch><switch test="`$vf-module-service-data.oper-status.order-status == Active`"><outcome value='false'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='Invalid order-status'/></return></outcome></switch><set> + <parameter name="vf-module-service-data.oper-status.last-order-status" value="`$vf-module-service-data.oper-status.order-status`"/></set><set> + <parameter name="vf-module-service-data.oper-status.order-status" value="Deleted"/></set><set> + <parameter name="vf-module-service-data.oper-status.last-action" value="`$vf-module-service-data.request-information.request-action`"/></set><set> + <parameter name="vf-module-service-data.vf-module-topology-information." value="" /> +</set><set> +<parameter name="ack-final" value="Y"/></set><return status='success'> + <parameter name="error-code" value="200" /></return></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-vf-module-topology-operation.xml b/platform-logic/vnfapi/src/main/xml/dg-vf-module-topology-operation.xml new file mode 100644 index 00000000..e0c32468 --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-vf-module-topology-operation.xml @@ -0,0 +1,90 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc='vf-module-topology-operation' mode='sync'> +<block atomic="true"><record plugin="org.openecomp.sdnc.sli.recording.FileRecorder"> +<parameter name="file" value="/opt/opendaylight/current/data/log/svclogic.log"/> +<parameter name="field1" value="__TIMESTAMP__"/> +<parameter name="field2" value="vf-module-topology-operation"/> +<parameter name="field3" value="`$vf-module-topology-operation-input.sdnc-request-header.svc-action`"/> +<parameter name="field4" value="`$vf-module-topology-operation-input.sdnc-request-header.svc-request-id`"/> +<parameter name="field5" value="`$vf-module-topology-operation-input.request-information.source`"/> +<parameter name="field6" value="`$vf-module-topology-operation-input.request-information.request-id`"/> +<parameter name="field7" value="`$vf-module-topology-operation-input.request-information.request-action`"/> +<parameter name="field8" value="`$vf-module-topology-operation-input.service-information.service-id`"/> +<parameter name="field9" value="`$vf-module-topology-operation-input.service-information.service-type`"/> +<parameter name="field10" value="`$vf-module-topology-operation-input.service-information.subscriber-name`"/> +<parameter name="field11" value="`$vf-module-topology-operation-input.service-information.service-instance-id`"/> +<parameter name="field12" value="`$vf-module-topology-operation-input.vf-module-topology-information.vf-module-id`"/> +<parameter name="field13" value="`$vf-module-topology-operation-input.vf-module-topology-information.vf-module-model-id`"/> +<parameter name="field14" value="`$vf-module-topology-operation-input.vf-module-topology-information.vf-module-name`"/> +<parameter name="field15" value="`$vf-module-topology-operation-input.vf-module-topology-information.request-version`"/> +<parameter name="field16" value="`$vf-module-topology-operation-input.vf-module-topology-information.vnf-instance-id`"/> +<parameter name="field17" value="`$vf-module-topology-operation-input.vf-module-topology-information.vnf-model-id`"/> +<parameter name="field18" value="`$vf-module-topology-operation-input.vf-module-topology-information.vnf-instance-name`"/> +<parameter name="field19" value="`$vf-module-topology-operation-input.vf-module-topology-information.aic-cloud-region`"/> +<parameter name="field20" value="`$vf-module-topology-operation-input.vf-module-topology-information.tenant`"/></record><switch test="`$vf-module-topology-operation-input.vf-module-request-information.vf-module-name`"><outcome value='Other'><switch test="`$vf-module-preload-data.vf-module-topology-information.vf-module-identifiers.vf-module-name`"><outcome value='Other'><switch test="`$vf-module-topology-operation-input.vf-module-request-information.vf-module-name == $vf-module-preload-data.vf-module-topology-information.vf-module-identifiers.vf-module-name`"><outcome value='false'> +<return status='failure'> + <parameter name='error-code' value='404'/> + <parameter name='error-message' value='vf-module-name not found in vf-module-preload-data'/></return></outcome></switch></outcome><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='No preload data found to match vf-module-name'/></return></outcome></switch></outcome><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='vf-module-name is required'/></return></outcome></switch><switch test="`$vf-module-topology-operation-input.vf-module-request-information.vf-module-model-id`"><outcome value='Other'><switch test="`$vf-module-preload-data.vf-module-topology-information.vf-module-identifiers.vf-module-model-id`"><outcome value='Other'><switch test="`$vf-module-topology-operation-input.vf-module-request-information.vf-module-model-id == $vf-module-preload-data.vf-module-topology-information.vf-module-identifiers.vf-module-model-id`"><outcome value='false'> +<return status='failure'> + <parameter name='error-code' value='404'/> + <parameter name='error-message' value='vf-module-model-id not found in vf-module-preload-data'/></return></outcome></switch></outcome><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='No preload data found to match vf-module-model-id from input'/></return></outcome></switch></outcome><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='vf-module-model-id is required'/></return></outcome></switch><switch test="`$vf-module-topology-operation-input.vf-module-request-information.vf-module-id`"><outcome value='0'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='vf-module-id cannot be NULL or 0'/></return></outcome><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='vf-module-id cannot be NULL or 0'/></return></outcome></switch><switch test="`$vf-module-topology-operation-input.vf-module-request-information.vnf-instance-id`"><outcome value='0'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='vnf-instance-id cannot be NULL or 0'/></return></outcome><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='vnf-instance-id cannot be NULL or 0'/></return></outcome></switch><switch test="`$vf-module-topology-operation-input.vf-module-request-information.vnf-instance-name`"><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='vnf-instance-name cannot be NULL'/></return></outcome></switch><switch test="`$vf-module-topology-operation-input.vf-module-request-information.vnf-model-id`"><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='vnf-model-id cannot be NULL'/></return></outcome></switch><switch test="`$vf-module-topology-operation-input.vf-module-request-information.aic-cloud-region`"><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='aic-cloud-region cannot be NULL'/></return></outcome></switch><switch test="`$vf-module-topology-operation-input.sdnc-request-header.svc-action`"> +<!-- +leaf svc-action { + type enumeration { + enum "reserve"; + enum "assign"; + enum "activate"; // equal to commit + enum "delete"; // equal to commit + enum "changeassign"; + enum "changedelete"; + enum "rollback"; + } +} +--> + +<outcome value='assign'><call module='VNF-API' rpc='vf-module-topology-assign' mode='sync' ></call></outcome><outcome value='changeassign'><call module='VNF-API' rpc='vf-module-topology-changeassign' mode='sync' ></call></outcome><outcome value='activate'><call module='VNF-API' rpc='vf-module-topology-activate' mode='sync' ></call></outcome><outcome value='rollback'><call module='VNF-API' rpc='vf-module-topology-rollback' mode='sync' ></call></outcome><outcome value='delete'><call module='VNF-API' rpc='vf-module-topology-delete' mode='sync' ></call></outcome><outcome value='Other'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='svc-action not recognized'/> +</return></outcome></switch></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-vf-module-topology-rollback.xml b/platform-logic/vnfapi/src/main/xml/dg-vf-module-topology-rollback.xml new file mode 100644 index 00000000..d0d80da6 --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-vf-module-topology-rollback.xml @@ -0,0 +1,35 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc='vf-module-topology-rollback' mode='sync'> +<block atomic="true"><switch test="`$vf-module-service-data.oper-status.order-status == PendingCreate`"><outcome value='true'><block atomic="true"><switch test="`$vf-module-topology-operation-input.vf-module-request-information.vf-module-id == $vf-module-service-data.vf-module-id`"><outcome value='false'> +<return status='failure'> + <parameter name='error-code' value='404'/> + <parameter name='error-message' value="`'vf-module-id = ' + $vf-module-topology-operation-input.vf-module-request-information.vf-module-id + ' not found in SDNC'`"/></return></outcome></switch><switch test="`$vf-module-service-data.oper-status.order-status == PendingCreate`"><outcome value='false'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='Invalid order-status'/></return></outcome></switch><set> + <parameter name="vf-module-service-data.oper-status.last-order-status" value="`$vf-module-service-data.oper-status.order-status`"/></set><set> + <parameter name="vf-module-service-data.oper-status.order-status" value="Deleted"/></set><set> + <parameter name="vf-module-service-data.oper-status.last-action" value="`$vf-modules-service-data.request-information.request-action`"/></set><set> + <parameter name="vf-module-service-data." value="" /> +</set><set> +<parameter name="ack-final" value="Y"/></set><return status='success'> + <parameter name="error-code" value="200" /></return></block></outcome></switch></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-vnf-instance-topology-activate.xml b/platform-logic/vnfapi/src/main/xml/dg-vnf-instance-topology-activate.xml new file mode 100644 index 00000000..0f07fcf9 --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-vnf-instance-topology-activate.xml @@ -0,0 +1,42 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc='vnf-instance-topology-activate' mode='sync'> +<block atomic="true"><switch test="`$vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id == $vnf-instance-service-data.vnf-instance-id`"><outcome value='false'> +<return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value="`'vnf-instance-id = ' + $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id + ' not found in SDNC'`"/></return></outcome></switch><switch test="`$vnf-instance-service-data.oper-status.order-status == PendingCreate`"><outcome value='false'><switch test="`$vnf-instance-service-data.oper-status.order-status == PendingUpdate`"><outcome value='false'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='Invalid order-status'/></return></outcome></switch></outcome></switch><set> + <parameter name="vnf-instance-service-data.oper-status.last-order-status" value="`$vnf-instance-service-data.oper-status.order-status`"/></set><set> + <parameter name="vnf-instance-service-data.oper-status.order-status" value="Active"/></set><set> + <parameter name="vnf-instance-service-data.oper-status.last-action" value="`$vnf-instance-service-data.request-information.request-action`"/></set><update plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="generic-vnf" + key="generic-vnf.vnf-id = $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id" > +<parameter name="orchestration-status" value="active" /><outcome value='failure'> +<return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'An error occurred while updating vnf-instance orchestration-status in AnAI with vnf-instance-id = ' + $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id`"/></return></outcome><outcome value='not-found'> +<return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'An error occurred while updating vnf-instance orchestration-status in AnAI with vnf-instance-id = ' + $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id`"/></return></outcome></update><set> + <parameter name="vnf-instance-service-data." value="vnf-instance-topology-operation-input." /></set><return status='success'> + <parameter name="error-code" value="200" /></return></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-vnf-instance-topology-assign-vnf-networks.xml b/platform-logic/vnfapi/src/main/xml/dg-vnf-instance-topology-assign-vnf-networks.xml new file mode 100644 index 00000000..40e84291 --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-vnf-instance-topology-assign-vnf-networks.xml @@ -0,0 +1,130 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc='vnf-instance-topology-assign-vnf-networks' mode='sync'> +<block atomic="true"><switch test="`$vnf-instance-preload-data.oper-status.order-status == PendingAssignment`"><outcome value='false'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='Invalid preload-data order status'/></return></outcome></switch><set> + <parameter name="vnf-instance-service-data." value="vnf-instance-preload-data." /></set><set> + <parameter name="vnf-instance-service-data." value="vnf-instance-topology-operation-input." /></set><set> + <parameter name="vnf-instance-service-data.vnf-instance-id" value="`$vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id`"/></set><switch test="`$vnf-instance-preload-data.vnf-instance-topology-information.vnf-assignments.vnf-networks_length`"><outcome value=''><set> +<parameter name = "vnf-instance-preload-data.vnf-instance-topology-information.vnf-assignments.vnf-networks_length" value="0" /> +</set></outcome></switch><for index="j" start="0" end="`$vnf-instance-preload-data.vnf-instance-topology-information.vnf-assignments.vnf-networks_length`"><block atomic="true"> +<set> +<parameter name='tmp.usePreload' value='1' /> +<parameter name='tmp.AnAI.l3network.' value='' /> +</set><switch test="`$vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-networks_length`"><outcome value=''><set> +<parameter name='vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-networks_length' value='0' /> +</set></outcome></switch><block atomic="true"> +<for index="i" start="0" end="`$vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-networks_length`"><switch test="`$vnf-instance-preload-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$j].network-role == $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-networks[$i].network-role`"><outcome value='true'> +<block atomic="true"> +<set> +<parameter name='tmp.usePreload' value='0' /> +</set><switch test="`$vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-networks[$i].network-id == '' or $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-networks[$i].network-id == '0'`"><outcome value='false'><get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-networks[$i].network-id" + pfx="tmp.AnAI.l3network"> +<outcome value='failure'> +<return status='failure'> +<parameter name='error-code' value='500' /> +<parameter name='error-message' value="`'An error occurred while querying AnAI for l3-network with network-id = ' + $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-networks[$i].network-id`" /> +</return></outcome><outcome value='not-found'> +<set> +<parameter name='tmp.usePreload' value='1' /> +</set></outcome></get-resource></outcome><outcome value='true'> +<switch test="`$vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-networks[$i].network-name == '' or $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-networks[$i].network-name == '0'`"><outcome value='true'> +<set> +<parameter name='tmp.usePreload' value='1' /> +</set></outcome><outcome value='false'><get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-name = $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-networks[$i].network-name" + pfx="tmp.AnAI.l3network"> + +<outcome value='failure'> +<return status='failure'> +<parameter name='error-code' value='500' /> +<parameter name='error-message' value="`'An error occurred while querying AnAI for l3-network with network-name = ' + $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-networks[$i].network-name`" /> +</return></outcome><outcome value='not-found'> +<set> +<parameter name='tmp.usePreload' value='1' /> +</set></outcome></get-resource></outcome></switch></outcome></switch><switch test="`$tmp.usePreload == 0`"><outcome value='true'> +<block> +<switch test="`$vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks_length`"><outcome value=''> +<set> + <parameter name="vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks_length" value = "0" /></set></outcome></switch><for index="k" start="0" end="`$vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks_length`"><switch test="`$vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$k].network-role == $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-networks[$i].network-role`"><outcome value='true'> +<block> +<set> +<parameter name="vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$k].network-name" value="`$tmp.AnAI.l3network.network-name`" /> +<parameter name="vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$k].network-id" value="`$tmp.AnAI.l3network.network-id`" /> +<parameter name="vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$k].neutron-id" value="`$tmp.AnAI.l3network.neutron-network-id`" /> +<parameter name="vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$k].contrail-network-fqdn" value="`$tmp.AnAI.l3network.contrail-network-fqdn`" /> +</set><switch test="`$vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-networks[$i].subnet-id != ''`"><outcome value='true'> +<set> +<parameter name="vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$k].subnet-id" value="`$vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-networks[$i].subnet-id`" /></set></outcome><outcome value='false'> +<switch test="`$vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-networks[$i].subnet-name != ''`"><outcome value='true'> +<switch test="`$tmp.AnAI.l3network.subnets.subnet_length != ''`"><outcome value='true'> +<for index="i" start="0" end="`$tmp.AnAI.l3network.subnets.subnet_length`"><switch test="`$tmp.AnAI.l3network.subnets.subnet[$i].subnet-name == $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-networks[$i].subnet-name`"><outcome value='true'> +<set> +<parameter name="vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$k].subnet-id" value="`$tmp.AnAI.l3network.subnets.subnet[$i].neutron-subnet-id`" /></set></outcome></switch></for></outcome></switch></outcome></switch></outcome></switch><switch test="`$vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-networks[$i].ipv6-subnet-id != ''`"><outcome value='true'> +<set> +<parameter name="vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$k].ipv6-subnet-id" value="`$vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-networks[$i].ipv6-subnet-id`" /></set></outcome><outcome value='false'> +<switch test="`$vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-networks[$i].ipv6-subnet-name != ''`"><outcome value='true'> +<switch test="`$tmp.AnAI.l3network.subnets.subnet_length != ''`"><outcome value='true'> +<for index="i" start="0" end="`$tmp.AnAI.l3network.subnets.subnet_length`"><switch test="`$tmp.AnAI.l3network.subnets.subnet[$i].subnet-name == $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-networks[$i].ipv6-subnet-name`"><outcome value='true'> +<set> +<parameter name="vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$k].ipv6-subnet-id" value="`$tmp.AnAI.l3network.subnets.subnet[$i].neutron-subnet-id`" /></set></outcome></switch></for></outcome></switch></outcome></switch></outcome></switch></block></outcome></switch></for></block></outcome></switch></block></outcome></switch></for><switch test="`$tmp.usePreload == 1`"><outcome value='true'><block atomic="true"> +<get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-name = $vnf-instance-preload-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$j].network-name" + pfx="tmp.AnAI.l3network"> +<outcome value='not-found'> +<return status='failure'> +<parameter name='error-code' value='500' /> +<parameter name='error-message' value="`'PRELOAD network-name = ' + $vnf-instance-preload-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$j].network-name + ' not found in AnAI'`" /> +</return></outcome><outcome value='failure'> +<return status='failure'> +<parameter name='error-code' value='500' /> +<parameter name='error-message' value="`'An error occurred while querying AnAI for l3-network with network-name = ' + $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-networks[$j].network-name`" /> +</return></outcome><outcome value='success'> +<switch test="`$tmp.AnAI.l3network.network-id == ''`"><outcome value='true'><return status='failure'> +<parameter name='error-code' value='500' /> +<parameter name='error-message' value="`'An error occurred while querying l3-network with network-name = ' + $vnf-instance-preload-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$j].network-name + ' , it is likely that there are more than one l3-newtork object with the same network-name in AnAI.'`" /> +</return></outcome></switch></outcome></get-resource><switch test="`$vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks_length`"><outcome value=''> +<set> + <parameter name="vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks_length" value = "0" /></set></outcome></switch><for index="k" start="0" end="`$vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks_length`"><switch test="`$vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$k].network-role == $vnf-instance-preload-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$j].network-role`"><outcome value='true'> +<block><set> +<parameter name="vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$k].network-name" value="`$tmp.AnAI.l3network.network-name`" /> +<parameter name="vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$k].network-id" value="`$tmp.AnAI.l3network.network-id`" /> +<parameter name="vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$k].neutron-id" value="`$tmp.AnAI.l3network.neutron-network-id`" /> +<parameter name="vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$k].contrail-network-fqdn" value="`$tmp.AnAI.l3network.contrail-network-fqdn`" /> + +</set><switch test="`$vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$k].subnet-id == ''`"><outcome value='true'> +<switch test="`$vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$k].subnet-name != ''`"><outcome value='true'> +<switch test="`$tmp.AnAI.l3network.subnets.subnet_length != ''`"><outcome value='true'> +<for index="i" start="0" end="`$tmp.AnAI.l3network.subnets.subnet_length`"><switch test="`$tmp.AnAI.l3network.subnets.subnet[$i].subnet-name == $vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$k].subnet-name`"><outcome value='true'> +<set> +<parameter name="vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$k].subnet-id" value="`$tmp.AnAI.l3network.subnets.subnet[$i].neutron-subnet-id`" /></set></outcome></switch></for></outcome></switch></outcome></switch></outcome></switch><switch test="`$vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$k].ipv6-subnet-id == ''`"><outcome value='true'> +<switch test="`$vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$k].ipv6-subnet-name != ''`"><outcome value='true'> +<switch test="`$tmp.AnAI.l3network.subnets.subnet_length != ''`"><outcome value='true'> +<for index="i" start="0" end="`$tmp.AnAI.l3network.subnets.subnet_length`"><switch test="`$tmp.AnAI.l3network.subnets.subnet[$i].subnet-name == $vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$k].ipv6-subnet-name`"><outcome value='true'> +<set> +<parameter name="vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$k].ipv6-subnet-id" value="`$tmp.AnAI.l3network.subnets.subnet[$i].neutron-subnet-id`" /></set></outcome></switch></for></outcome></switch></outcome></switch></outcome></switch></block></outcome></switch></for></block></outcome></switch></block></block></for><return status='success'> + <parameter name="error-code" value="200" /></return></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-vnf-instance-topology-assign.xml b/platform-logic/vnfapi/src/main/xml/dg-vnf-instance-topology-assign.xml new file mode 100644 index 00000000..ca5ff845 --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-vnf-instance-topology-assign.xml @@ -0,0 +1,58 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc='vnf-instance-topology-assign' mode='sync'> +<block atomic="true"><get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="generic-vnf" + key="generic-vnf.vnf-id = $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id" + pfx="tmp.AnAI.vnf-instance" ><outcome value='failure'> +<return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'An error occurred while querying generic-vnf from AnAI with vnf-instance-id = ' + $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id`"/></return></outcome><outcome value='not-found'> +<return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'generic-vnf not found in AnAI with vnf-instance-id = ' + $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id`"/></return></outcome></get-resource><call module='VNF-API' rpc='vnf-instance-topology-assign-vnf-networks' mode='sync' ></call><switch test="`$vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks_length`"><outcome value=''><set> +<parameter name='vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks_length' value='0' /> +</set></outcome></switch><for index="i" start="0" end="`$vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks_length`"><save plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="generic-vnf:relationship-list" + key="generic-vnf.vnf-id = $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id" > + <parameter name="relationship-list.relationship[0].related-to" value="l3-network" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="l3-network.network-id" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$i].network-id`" /><outcome value='failure'> +<block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="generic-vnf:relationship-list" + key="generic-vnf.vnf-id = $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id + AND related-to = l3-network" ></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'An error occurred while saving generic-vnf l3-network relationship in AnAI with network-id = ' + $vnf-instance.service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$i].network-id`"/></return></block></outcome></save></for><update plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="generic-vnf" + key="generic-vnf.vnf-id = $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id" > + <parameter name="orchestration-status" value="pending-create" /><outcome value='failure'> +<block atomic="true"> +<delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="generic-vnf:relationship-list" + key="generic-vnf.vnf-id = $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id + AND related-to = l3-network" ></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="An error occurred while updating vnf-instance orchestration-status in AnAI"/></return></block></outcome></update><set> + <parameter name="vnf-instance-service-data.oper-status.order-status" value="PendingCreate"/></set><set> +<parameter name="ack-final" value="Y"/></set><return status='success'> + <parameter name="error-code" value="200" /></return></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-vnf-instance-topology-changeassign.xml b/platform-logic/vnfapi/src/main/xml/dg-vnf-instance-topology-changeassign.xml new file mode 100644 index 00000000..6b1c1f21 --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-vnf-instance-topology-changeassign.xml @@ -0,0 +1,80 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc='vnf-instance-topology-changeassign' mode='sync'> +<block atomic="true"><switch test="`$vnf-instance-service-data.oper-status.order-status == Active`"><outcome value='false'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='Invalid service-data order status'/></return></outcome></switch><call module='VNF-API' rpc='vnf-instance-topology-assign-vnf-networks' mode='sync' ></call><get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="generic-vnf" + key="generic-vnf.vnf-id = $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id" + pfx="tmp.AnAI.vnf-instance" ><outcome value='failure'> +<return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'An error occurred while querying generic-vnf from AnAI with vnf-instance-id = ' + $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id`"/></return></outcome><outcome value='not-found'> +<return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'An error occurred while querying generic-vnf from AnAI with vnf-instance-id = ' + $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id`"/></return></outcome></get-resource><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="generic-vnf:relationship-list" + key="generic-vnf.vnf-id = $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id + AND related-to = l3-network" ><outcome value='failure'> +<return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'An error occurred while deleting existing l3-network relationship in AnAI with with vnf-instance-id = ' + $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id + ' vnf-instance update FAILED.'`"/></return></outcome></delete><switch test="`$vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks_length`"><outcome value=''> +<set> + <parameter name="vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks_length" value = "0" /></set></outcome></switch><for index="i" start="0" end="`$vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks_length`"><save plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="generic-vnf:relationship-list" + key="generic-vnf.vnf-id = $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id" > + + <parameter name="relationship-list.relationship[0].related-to" value="l3-network" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="l3-network.network-id" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$i].network-id`" /><outcome value='failure'> +<block atomic='true'><set> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`' | An error occurred while saving l3-network relationship with network-id = ' + $vnf-instance-service-data.vnf-instance-topology-information.vnf-assignments.vnf-networks[$i].network-id + ' for vnf-instance with vnf-instance-id = ' + $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id`" /> +</set><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="generic-vnf:relationship-list" + key="generic-vnf.vnf-id = $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id + AND related-to = l3-network" ></delete><switch test="`$tmp.AnAI.vnf-instance.relationship-list.relationship_length`"><outcome value=''> +<set> + <parameter name="tmp.AnAI.vnf-instance.relationship-list.relationship_length" value = "0" /></set></outcome></switch><for index="i" start="0" end="`$tmp.AnAI.vnf-instance.relationship-list.relationship_length`"><switch test="`$tmp.AnAI.vnf-instance.relationship-list.relationship[$i].related-to`"><outcome value='l3-network'><block atomic='true'><switch test="`$tmp.AnAI.vnf-instance.relationship-list.relationship[$i].relationship-data_length`"><outcome value=''> +<set> + <parameter name="tmp.AnAI.vnf-instance.relationship-list.relationship[$i].relationship-data_length" value = "0" /></set></outcome></switch><for index="j" start="0" end="`$tmp.AnAI.vnf-instance.relationship-list.relationship[$i].relationship-data_length`"><save plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="generic-vnf:relationship-list" + key="generic-vnf.vnf-id = $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id" > + + <parameter name="relationship-list.relationship[0].related-to" value="l3-network" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="l3-network.network-id" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.AnAI.vnf-instance.relationship-list.relationship[$i].relationship-data[$j].relationship-value`" /><outcome value='failure'> +<set> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$error-message + ' | An error occurred while during rollback of l3-network relationship for vnf-instance with vnf-instance-id = ' + $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id`" /> +</set></outcome><outcome value='not-found'> +<set> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$error-message + ' | An error occurred while during rollback of l3-network relationship for vnf-instance with vnf-instance-id = ' + $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id`" /> +</set></outcome></save></for></block></outcome></switch></for><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Failed to update vnf-instance l3-network relationship in AnAI. ' + $error-message`"/></return></block></outcome></save></for><set> + <parameter name="vnf-instance-service-data.oper-status.last-order-status" value="`$vnf-instance-service-data.oper-status.order-status`"/></set><set> + <parameter name="vnf-instance-service-data.oper-status.order-status" value="PendingUpdate"/></set><set> + <parameter name="vnf-instance-service-data.oper-status.last-action" value="`$vnf-instance-service-data.request-information.request-action`"/></set><set> +<parameter name="ack-final" value="Y"/></set><return status='success'> + <parameter name="error-code" value="200" /></return></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-vnf-instance-topology-delete.xml b/platform-logic/vnfapi/src/main/xml/dg-vnf-instance-topology-delete.xml new file mode 100644 index 00000000..1c683bea --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-vnf-instance-topology-delete.xml @@ -0,0 +1,35 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc='vnf-instance-topology-delete' mode='sync'> +<block atomic="true"><switch test="`$vnf-instance-topology-operation-input.vnf-instance-request-information.vf-module-id == $vf-module-service-data.vnf-instance-id`"><outcome value='false'> +<return status='failure'> + <parameter name='error-code' value='404'/> + <parameter name='error-message' value='vf-module-id not found in SDNC'/></return></outcome></switch><switch test="`$vnf-instance-service-data.oper-status.order-status == Active`"><outcome value='false'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='Invalid order-status'/></return></outcome></switch><set> + <parameter name="vnf-instance-service-data.oper-status.last-order-status" value="`$vnf-instance-service-data.oper-status.order-status`"/></set><set> + <parameter name="vnf-instance-service-data.oper-status.order-status" value="Deleted"/></set><set> + <parameter name="vnf-instance-service-data.oper-status.last-action" value="`$vnf-instance-service-data.request-information.request-action`"/></set><set> + <parameter name="vnf-instance-service-data.vnf-instance-topology-information." value="" /> +</set><set> +<parameter name="ack-final" value="Y"/></set><return status='success'> + <parameter name="error-code" value="200" /></return></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-vnf-instance-topology-operation.xml b/platform-logic/vnfapi/src/main/xml/dg-vnf-instance-topology-operation.xml new file mode 100644 index 00000000..322819b7 --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-vnf-instance-topology-operation.xml @@ -0,0 +1,65 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc='vnf-instance-topology-operation' mode='sync'> +<block atomic="true"><record plugin="org.openecomp.sdnc.sli.recording.FileRecorder"> +<parameter name="file" value="/opt/opendaylight/current/data/log/svclogic.log"/> +<parameter name="field1" value="__TIMESTAMP__"/> +<parameter name="field2" value="vnf-instance-topology-operation"/> +<parameter name="field3" value="`$vnf-instance-topology-operation-input.sdnc-request-header.svc-action`"/> +<parameter name="field4" value="`$vnf-instance-topology-operation-input.sdnc-request-header.svc-request-id`"/> +<parameter name="field5" value="`$vnf-instance-topology-operation-input.request-information.source`"/> +<parameter name="field6" value="`$vnf-instance-topology-operation-input.request-information.request-id`"/> +<parameter name="field7" value="`$vnf-instance-topology-operation-input.request-information.request-action`"/> +<parameter name="field8" value="`$vnf-instance-topology-operation-input.service-information.service-id`"/> +<parameter name="field9" value="`$vnf-instance-topology-operation-input.service-information.service-type`"/> +<parameter name="field10" value="`$vnf-instance-topology-operation-input.service-information.subscriber-name`"/> +<parameter name="field11" value="`$vnf-instance-topology-operation-input.service-information.service-instance-id`"/> +<parameter name="field12" value="`$vnf-instance-topology-operation-input.vnf-instance-request-information.request-version`"/> +<parameter name="field13" value="`$vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id`"/> +<parameter name="field14" value="`$vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-model-id`"/> +<parameter name="field15" value="`$vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-name`"/> +<parameter name="field16" value="`$vnf-instance-topology-operation-input.vnf-instance-request-information.aic-cloud-region`"/> +<parameter name="field17" value="`$vnf-instance-topology-operation-input.vnf-instance-request-information.tenant`"/></record><switch test="`$vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-name`"><outcome value='Other'><switch test="`$vnf-instance-preload-data.vnf-instance-topology-information.vnf-instance-identifiers.vnf-instance-name`"><outcome value='Other'><switch test="`$vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-name == $vnf-instance-preload-data.vnf-instance-topology-information.vnf-instance-identifiers.vnf-instance-name`"><outcome value='false'> +<return status='failure'> + <parameter name='error-code' value='404'/> + <parameter name='error-message' value='vnf-instance-name from input not found in vnf-instance-preload-data'/></return></outcome></switch></outcome><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='No preload data found to match vnf-instance-name from input'/></return></outcome></switch></outcome><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='vnf-instance-name is required'/></return></outcome></switch><switch test="`$vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-model-id`"><outcome value='Other'><switch test="`$vnf-instance-preload-data.vnf-instance-topology-information.vnf-instance-identifiers.vnf-model-id`"><outcome value='Other'><switch test="`$vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-model-id == $vnf-instance-preload-data.vnf-instance-topology-information.vnf-instance-identifiers.vnf-model-id`"><outcome value='false'> +<return status='failure'> + <parameter name='error-code' value='404'/> + <parameter name='error-message' value='request.vnf-model-id not found in vnf-instance-preload-data'/></return></outcome></switch></outcome><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='No preload data found to match vnf-model-id from input'/></return></outcome></switch></outcome><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='vnf-model-id is required'/></return></outcome></switch><switch test="`$vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id`"><outcome value='0'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='vf-instance-id cannot be NULL or 0'/></return></outcome><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='vf-instance-id cannot be NULL or 0'/></return></outcome></switch><switch test="`$vnf-instance-topology-operation-input.vnf-instance-request-information.aic-cloud-region`"><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='aic-cloud-region cannot be NULL'/></return></outcome></switch><switch test="`$vnf-instance-topology-operation-input.sdnc-request-header.svc-action`"> +<outcome value='assign'><call module='VNF-API' rpc='vnf-instance-topology-assign' mode='sync' ></call></outcome><outcome value='changeassign'><call module='VNF-API' rpc='vnf-instance-topology-changeassign' mode='sync' ></call></outcome><outcome value='activate'><call module='VNF-API' rpc='vnf-instance-topology-activate' mode='sync' ></call></outcome><outcome value='rollback'><call module='VNF-API' rpc='vnf-instance-topology-rollback' mode='sync' ></call></outcome><outcome value='delete'><call module='VNF-API' rpc='vnf-instance-topology-delete' mode='sync' ></call></outcome><outcome value='Other'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='svc-action not recognized'/> +</return></outcome></switch></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-vnf-instance-topology-rollback.xml b/platform-logic/vnfapi/src/main/xml/dg-vnf-instance-topology-rollback.xml new file mode 100644 index 00000000..2ef20414 --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-vnf-instance-topology-rollback.xml @@ -0,0 +1,35 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc='vnf-instance-topology-rollback' mode='sync'> +<block atomic="true"><switch test="`$vnf-instance-service-data.oper-status.order-status == PendingCreate`"><outcome value='true'><block atomic="true"><switch test="`$vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id == $vnf-instance-service-data.vnf-instance-id`"><outcome value='false'> +<return status='failure'> + <parameter name='error-code' value='404'/> + <parameter name='error-message' value="`'vnf-instance-id = ' + $vnf-instance-topology-operation-input.vnf-instance-request-information.vnf-instance-id + ' not found in SDNC'`"/></return></outcome></switch><switch test="`$vnf-instance-service-data.oper-status.order-status == PendingCreate`"><outcome value='false'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='Invalid order-status'/></return></outcome></switch><set> + <parameter name="vnf-instance-service-data.oper-status.last-order-status" value="`$vnf-instance-service-data.oper-status.order-status`"/></set><set> + <parameter name="vnf-instance-service-data.oper-status.order-status" value="Deleted"/></set><set> + <parameter name="vnf-instance-service-data.oper-status.last-action" value="`$vnf-instances-service-data.request-information.request-action`"/></set><set> + <parameter name="vnf-instance-service-data." value="" /> +</set><set> +<parameter name="ack-final" value="Y"/></set><return status='success'> + <parameter name="error-code" value="200" /></return></block></outcome></switch></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-vnf-topology-activate.xml b/platform-logic/vnfapi/src/main/xml/dg-vnf-topology-activate.xml new file mode 100644 index 00000000..81ad5bf5 --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-vnf-topology-activate.xml @@ -0,0 +1,65 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc='vnf-topology-activate' mode='sync'> +<block atomic="true"><switch test="`$vnf-topology-operation-input.vnf-request-information.vnf-id == $service-data.vnf-id`"><outcome value='false'> +<return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value="`'vnf-id = ' + $vnf-topology-operation-input.vnf-request-information.vnf-id + ' not found in config tree'`"/></return></outcome></switch><switch test="`$service-data.oper-status.order-status == PendingCreate`"> + +<!-- +leaf order-status { + type enumeration { + enum "Active"; + enum "PendingAssignment"; + enum "PendingCreate"; + enum "PendingUpdate"; + enum "Deleted"; + } +} +--><outcome value='false'><switch test="`$service-data.oper-status.order-status == PendingUpdate`"> + +<!-- +leaf order-status { + type enumeration { + enum "Active"; + enum "PendingAssignment"; + enum "PendingCreate"; + enum "PendingUpdate"; + enum "Deleted"; + } +} +--><outcome value='false'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='Invalid last-order-status'/></return></outcome></switch></outcome></switch><set> + <parameter name="service-data.oper-status.last-order-status" value="`$service-data.oper-status.order-status`"/></set><set> + <parameter name="service-data.oper-status.order-status" value="Active"/></set><set> + <parameter name="service-data.oper-status.last-action" value="`$service-data.request-information.request-action`"/></set><update plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="vf-module" + key="vf-module.vf-module-id = $vnf-topology-operation-input.vnf-request-information.vnf-id + AND generic-vnf.vnf-id = $vnf-topology-operation-input.vnf-request-information.generic-vnf-id" + local-only="false" > + <parameter name="orchestration-status" value="active" /><outcome value='failure'> +<return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Encountered error while updating vf-module orchestration-status in AnAI with vnf-id = ' + $vnf-topology-operation-input.vnf-request-information.vnf-id + ' and generic-vnf-id = ' + $vnf-topology-operation-input.vnf-request-information.generic-vnf-id`"/></return></outcome></update><set> + <parameter name="service-data." value="vnf-topology-operation-input." /></set><return status='success'> + <parameter name="error-code" value="200" /></return></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-vnf-topology-assign-vfmodule.xml b/platform-logic/vnfapi/src/main/xml/dg-vnf-topology-assign-vfmodule.xml new file mode 100644 index 00000000..e297a90d --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-vnf-topology-assign-vfmodule.xml @@ -0,0 +1,148 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc='vnf-topology-assign-vfmodule' mode='sync'> +<block atomic="true"><switch test="`$preload-data.oper-status.order-status == PendingAssignment`"> +<!-- +leaf order-status { + type enumeration { + enum "Active"; + enum "PendingAssignment"; + enum "PendingCreate"; + enum "PendingUpdate"; + enum "Deleted"; + } +} +--><outcome value='false'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='Invalid preload-data order status'/></return></outcome></switch><set> + <parameter name="service-data." value="preload-data." /></set><set> + <parameter name="service-data." value="vnf-topology-operation-input." /></set><set> + <parameter name="service-data.vnf-id" value="`$vnf-topology-operation-input.vnf-request-information.vnf-id`"/> + <parameter name="service-data.service-information.service-instance-id" value="`$vnf-topology-operation-input.service-information.service-instance-id`"/> + <parameter name="service-data.vnf-request-information.vnf-id" value="`$vnf-topology-operation-input.vnf-request-information.vnf-id`"/> + <parameter name="service-data.vnf-topology-information.vnf-topology-identifier.vnf-id" value="`$vnf-topology-operation-input.vnf-request-information.vnf-id`"/></set><switch test="`$preload-data.vnf-topology-information.vnf-assignments.vnf-networks_length`"><outcome value=''><set> +<parameter name = "preload-data.vnf-topology-information.vnf-assignments.vnf-networks_length" value="0" /> +</set></outcome></switch><for index="j" start="0" end="`$preload-data.vnf-topology-information.vnf-assignments.vnf-networks_length`"><block atomic="true"> +<set> +<parameter name='tmp.usePreload' value='1' /> +<parameter name='tmp.AnAI.l3network.' value='' /> +</set><switch test="`$vnf-topology-operation-input.vnf-request-information.vnf-networks_length`"><outcome value=''><set> +<parameter name='vnf-topology-operation-input.vnf-request-information.vnf-networks_length' value='0' /> +</set></outcome></switch><block atomic="true"> +<for index="i" start="0" end="`$vnf-topology-operation-input.vnf-request-information.vnf-networks_length`"><switch test="`$preload-data.vnf-topology-information.vnf-assignments.vnf-networks[$j].network-role == $vnf-topology-operation-input.vnf-request-information.vnf-networks[$i].network-role`"><outcome value='true'> +<block atomic="true"> +<set> +<parameter name='tmp.usePreload' value='0' /> +</set><switch test="`$vnf-topology-operation-input.vnf-request-information.vnf-networks[$i].network-id == '' or $vnf-topology-operation-input.vnf-request-information.vnf-networks[$i].network-id == '0'`"><outcome value='false'><get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-id = $vnf-topology-operation-input.vnf-request-information.vnf-networks[$i].network-id" + local-only="false" + pfx="tmp.AnAI.l3network"> +<outcome value='failure'> +<return status='failure'> +<parameter name='error-code' value='500' /> +<parameter name='error-message' value="`'Failed to query AnAI for l3-network with network-id = ' + $vnf-topology-operation-input.vnf-request-information.vnf-networks[$i].network-id`" /> +</return></outcome><outcome value='not-found'> +<set> +<parameter name='tmp.usePreload' value='1' /> +</set></outcome></get-resource></outcome><outcome value='true'> +<switch test="`$vnf-topology-operation-input.vnf-request-information.vnf-networks[$i].network-name == '' or $vnf-topology-operation-input.vnf-request-information.vnf-networks[$i].network-name == '0'`"><outcome value='true'> +<set> +<parameter name='tmp.usePreload' value='1' /> +</set></outcome><outcome value='false'><get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-name = $vnf-topology-operation-input.vnf-request-information.vnf-networks[$i].network-name" + local-only="false" + pfx="tmp.AnAI.l3network"> + +<outcome value='failure'> +<return status='failure'> +<parameter name='error-code' value='500' /> +<parameter name='error-message' value="`'Failed to query AnAI for l3-network with network-name = ' + $vnf-topology-operation-input.vnf-request-information.vnf-networks[$i].network-name`" /> +</return></outcome><outcome value='not-found'> +<set> +<parameter name='tmp.usePreload' value='1' /> +</set></outcome></get-resource></outcome></switch></outcome></switch><switch test="`$tmp.usePreload == 0`"><outcome value='true'> +<block> +<switch test="`$service-data.vnf-topology-information.vnf-assignments.vnf-networks_length`"><outcome value=''> +<set> + <parameter name="service-data.vnf-topology-information.vnf-assignments.vnf-networks_length" value = "0" /></set></outcome></switch><for index="k" start="0" end="`$service-data.vnf-topology-information.vnf-assignments.vnf-networks_length`"><switch test="`$service-data.vnf-topology-information.vnf-assignments.vnf-networks[$k].network-role == $vnf-topology-operation-input.vnf-request-information.vnf-networks[$i].network-role`"><outcome value='true'> +<block> +<set> +<parameter name="service-data.vnf-topology-information.vnf-assignments.vnf-networks[$k].network-name" value="`$tmp.AnAI.l3network.network-name`" /> +<parameter name="service-data.vnf-topology-information.vnf-assignments.vnf-networks[$k].network-id" value="`$tmp.AnAI.l3network.network-id`" /> +<parameter name="service-data.vnf-topology-information.vnf-assignments.vnf-networks[$k].neutron-id" value="`$tmp.AnAI.l3network.neutron-network-id`" /> +<parameter name="service-data.vnf-topology-information.vnf-assignments.vnf-networks[$k].contrail-network-fqdn" value="`$tmp.AnAI.l3network.contrail-network-fqdn`" /> +</set><switch test="`$vnf-topology-operation-input.vnf-request-information.vnf-networks[$i].subnet-id != ''`"><outcome value='true'> +<set> +<parameter name="service-data.vnf-topology-information.vnf-assignments.vnf-networks[$k].subnet-id" value="`$vnf-topology-operation-input.vnf-request-information.vnf-networks[$i].subnet-id`" /></set></outcome><outcome value='false'> +<switch test="`$vnf-topology-operation-input.vnf-request-information.vnf-networks[$i].subnet-name != ''`"><outcome value='true'> +<switch test="`$tmp.AnAI.l3network.subnets.subnet_length != ''`"><outcome value='true'> +<for index="i" start="0" end="`$tmp.AnAI.l3network.subnets.subnet_length`"><switch test="`$tmp.AnAI.l3network.subnets.subnet[$i].subnet-name == $vnf-topology-operation-input.vnf-request-information.vnf-networks[$i].subnet-name`"><outcome value='true'> +<set> +<parameter name="service-data.vnf-topology-information.vnf-assignments.vnf-networks[$k].subnet-id" value="`$tmp.AnAI.l3network.subnets.subnet[$i].neutron-subnet-id`" /></set></outcome></switch></for></outcome></switch></outcome></switch></outcome></switch><switch test="`$vnf-topology-operation-input.vnf-request-information.vnf-networks[$i].ipv6-subnet-id != ''`"><outcome value='true'> +<set> +<parameter name="service-data.vnf-topology-information.vnf-assignments.vnf-networks[$k].ipv6-subnet-id" value="`$vnf-topology-operation-input.vnf-request-information.vnf-networks[$i].ipv6-subnet-id`" /></set></outcome><outcome value='false'> +<switch test="`$vnf-topology-operation-input.vnf-request-information.vnf-networks[$i].ipv6-subnet-name != ''`"><outcome value='true'> +<switch test="`$tmp.AnAI.l3network.subnets.subnet_length != ''`"><outcome value='true'> +<for index="i" start="0" end="`$tmp.AnAI.l3network.subnets.subnet_length`"><switch test="`$tmp.AnAI.l3network.subnets.subnet[$i].subnet-name == $vnf-topology-operation-input.vnf-request-information.vnf-networks[$i].ipv6-subnet-name`"><outcome value='true'> +<set> +<parameter name="service-data.vnf-topology-information.vnf-assignments.vnf-networks[$k].ipv6-subnet-id" value="`$tmp.AnAI.l3network.subnets.subnet[$i].neutron-subnet-id`" /></set></outcome></switch></for></outcome></switch></outcome></switch></outcome></switch></block></outcome></switch></for></block></outcome></switch></block></outcome></switch></for><switch test="`$tmp.usePreload == 1`"><outcome value='true'><block atomic="true"> +<get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="l3-network" + key="l3-network.network-name = $preload-data.vnf-topology-information.vnf-assignments.vnf-networks[$j].network-name" + local-only="false" + pfx="tmp.AnAI.l3network"> +<outcome value='not-found'> +<return status='failure'> +<parameter name='error-code' value='500' /> +<parameter name='error-message' value="`'PRELOAD network-name = ' + $preload-data.vnf-topology-information.vnf-assignments.vnf-networks[$j].network-name + ' not found in AnAI'`" /> +</return></outcome><outcome value='failure'> +<return status='failure'> +<parameter name='error-code' value='500' /> +<parameter name='error-message' value="`'Failed to query AnAI for l3-network with network-name = ' + $vnf-topology-operation-input.vnf-request-information.vnf-networks[$j].network-name`" /> +</return></outcome><outcome value='success'> +<switch test="`$tmp.AnAI.l3network.network-id == ''`"><outcome value='true'><return status='failure'> +<parameter name='error-code' value='500' /> +<parameter name='error-message' value="`'An error occurred while querying l3-network with network-name = ' + $preload-data.vnf-topology-information.vnf-assignments.vnf-networks[$j].network-name + ' , it is likely that there are more than one l3-newtork object with the same network-name in AnAI.'`" /> +</return></outcome></switch></outcome></get-resource><switch test="`$service-data.vnf-topology-information.vnf-assignments.vnf-networks_length`"><outcome value=''> +<set> + <parameter name="service-data.vnf-topology-information.vnf-assignments.vnf-networks_length" value = "0" /></set></outcome></switch><for index="k" start="0" end="`$service-data.vnf-topology-information.vnf-assignments.vnf-networks_length`"><switch test="`$service-data.vnf-topology-information.vnf-assignments.vnf-networks[$k].network-role == $preload-data.vnf-topology-information.vnf-assignments.vnf-networks[$j].network-role`"><outcome value='true'> +<block> +<set> +<parameter name="service-data.vnf-topology-information.vnf-assignments.vnf-networks[$k].network-name" value="`$tmp.AnAI.l3network.network-name`" /> +<parameter name="service-data.vnf-topology-information.vnf-assignments.vnf-networks[$k].network-id" value="`$tmp.AnAI.l3network.network-id`" /> +<parameter name="service-data.vnf-topology-information.vnf-assignments.vnf-networks[$k].neutron-id" value="`$tmp.AnAI.l3network.neutron-network-id`" /> +<parameter name="service-data.vnf-topology-information.vnf-assignments.vnf-networks[$k].contrail-network-fqdn" value="`$tmp.AnAI.l3network.contrail-network-fqdn`" /> + +</set><switch test="`$service-data.vnf-topology-information.vnf-assignments.vnf-networks[$k].subnet-id == ''`"><outcome value='true'> +<switch test="`$service-data.vnf-topology-information.vnf-assignments.vnf-networks[$k].subnet-name != ''`"><outcome value='true'> +<switch test="`$tmp.AnAI.l3network.subnets.subnet_length != ''`"><outcome value='true'> +<for index="i" start="0" end="`$tmp.AnAI.l3network.subnets.subnet_length`"><switch test="`$tmp.AnAI.l3network.subnets.subnet[$i].subnet-name == $service-data.vnf-topology-information.vnf-assignments.vnf-networks[$k].subnet-name`"><outcome value='true'> +<set> +<parameter name="service-data.vnf-topology-information.vnf-assignments.vnf-networks[$k].subnet-id" value="`$tmp.AnAI.l3network.subnets.subnet[$i].neutron-subnet-id`" /></set></outcome></switch></for></outcome></switch></outcome></switch></outcome></switch><switch test="`$service-data.vnf-topology-information.vnf-assignments.vnf-networks[$k].ipv6-subnet-id == ''`"><outcome value='true'> +<switch test="`$service-data.vnf-topology-information.vnf-assignments.vnf-networks[$k].ipv6-subnet-name != ''`"><outcome value='true'> +<switch test="`$tmp.AnAI.l3network.subnets.subnet_length != ''`"><outcome value='true'> +<for index="i" start="0" end="`$tmp.AnAI.l3network.subnets.subnet_length`"><switch test="`$tmp.AnAI.l3network.subnets.subnet[$i].subnet-name == $service-data.vnf-topology-information.vnf-assignments.vnf-networks[$k].ipv6-subnet-name`"><outcome value='true'> +<set> +<parameter name="service-data.vnf-topology-information.vnf-assignments.vnf-networks[$k].ipv6-subnet-id" value="`$tmp.AnAI.l3network.subnets.subnet[$i].neutron-subnet-id`" /></set></outcome></switch></for></outcome></switch></outcome></switch></outcome></switch></block></outcome></switch></for></block></outcome></switch></block></block></for><return status='success'> + <parameter name="error-code" value="200" /></return></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-vnf-topology-assign.xml b/platform-logic/vnfapi/src/main/xml/dg-vnf-topology-assign.xml new file mode 100644 index 00000000..50c2f0c2 --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-vnf-topology-assign.xml @@ -0,0 +1,72 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc='vnf-topology-assign' mode='sync'> +<block atomic="true"><get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="vf-module" + key="vf-module.vf-module-id = $vnf-topology-operation-input.vnf-request-information.vnf-id + and generic-vnf.vnf-id = $vnf-topology-operation-input.vnf-request-information.generic-vnf-id" + local-only="false" + pfx="tmp.AnAI.vfmodule" ><outcome value='failure'> +<return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Encountered error while querying vf-module from AnAI with vf-module-id = ' + $vnf-topology-operation-input.vnf-request-information.vnf-id + ' and generic-vnf-id = ' + $vnf-topology-operation-input.vnf-request-information.generic-vnf-id`"/></return></outcome><outcome value='not-found'> +<return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'vf-module not found in AnAI with vf-module-id = ' + $vnf-topology-operation-input.vnf-request-information.vnf-id + ' and generic-vnf-id = ' + $vnf-topology-operation-input.vnf-request-information.generic-vnf-id`"/></return></outcome></get-resource><call module='VNF-API' rpc='vnf-topology-assign-vfmodule' mode='sync' ></call><switch test="`$service-data.vnf-topology-information.vnf-assignments.vnf-networks_length`"><outcome value=''><set> +<parameter name='service-data.vnf-topology-information.vnf-assignments.vnf-networks_length' value='0' /> +</set></outcome></switch><for index="i" start="0" end="`$service-data.vnf-topology-information.vnf-assignments.vnf-networks_length`"><save plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="vf-module:relationship-list" + key="vf-module.vf-module-id = $vnf-topology-operation-input.vnf-request-information.vnf-id + and generic-vnf.vnf-id = $vnf-topology-operation-input.vnf-request-information.generic-vnf-id" + force="true" + local-only="false"> + + <parameter name="relationship-list.relationship[0].related-to" value="l3-network" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="l3-network.network-id" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$service-data.vnf-topology-information.vnf-assignments.vnf-networks[$i].network-id`" /><outcome value='failure'> +<block atomic='true'><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="vf-module:relationship-list" + key="vf-module.vf-module-id = $vnf-topology-operation-input.vnf-request-information.vnf-id + AND generic-vnf.vnf-id = $vnf-topology-operation-input.vnf-request-information.generic-vnf-id + AND related-to = l3-network" + force="true" + local-only="false"></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Encountered error while saving vf-module l3-network relationship in AnAI with network-id = ' + $service-data.vnf-topology-information.vnf-assignments.vnf-networks[$i].network-id`"/></return></block></outcome></save></for><update plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="vf-module" + key="vf-module.vf-module-id = $vnf-topology-operation-input.vnf-request-information.vnf-id + and generic-vnf.vnf-id = $vnf-topology-operation-input.vnf-request-information.generic-vnf-id" + local-only="false" > + <parameter name="orchestration-status" value="pending-create" /><outcome value='failure'> +<block atomic="true"> +<delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="vf-module:relationship-list" + key="vf-module.vf-module-id = $vnf-topology-operation-input.vnf-request-information.vnf-id + AND generic-vnf.vnf-id = $vnf-topology-operation-input.vnf-request-information.generic-vnf-id + AND related-to = l3-network" + force="true" + local-only="false"></delete><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="Encountered error while updating vf-module orchestration-status in AnAI"/></return></block></outcome></update><set> + <parameter name="service-data.oper-status.order-status" value="PendingCreate"/></set><set> +<parameter name="ack-final" value="Y"/></set><return status='success'> + <parameter name="error-code" value="200" /></return></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-vnf-topology-changeassign.xml b/platform-logic/vnfapi/src/main/xml/dg-vnf-topology-changeassign.xml new file mode 100644 index 00000000..68f1162f --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-vnf-topology-changeassign.xml @@ -0,0 +1,100 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc='vnf-topology-changeassign' mode='sync'> +<block atomic="true"><switch test="`$service-data.oper-status.order-status == Active`"> +<!-- +leaf order-status { + type enumeration { + enum "Active"; + enum "PendingAssignment"; + enum "PendingCreate"; + enum "PendingUpdate"; + enum "Deleted"; + } +} +--><outcome value='false'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='Invalid service-data order status'/></return></outcome></switch><call module='VNF-API' rpc='vnf-topology-assign-vfmodule' mode='sync' ></call><get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="vf-module" + key="vf-module.vf-module-id = $vnf-topology-operation-input.vnf-request-information.vnf-id + and generic-vnf.vnf-id = $vnf-topology-operation-input.vnf-request-information.generic-vnf-id" + local-only="false" + pfx="tmp.AnAI.vfmodule"><outcome value='failure'> +<return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'An error occurred while querying vf-module from AnAI with vf-module-id = ' + $vnf-topology-operation-input.vnf-request-information.vnf-id + ' and generic-vnf-id = ' + $vnf-topology-operation-input.vnf-request-information.generic-vnf-id`"/></return></outcome><outcome value='not-found'> +<return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'An error occurred while querying vf-module from AnAI with vf-module-id = ' + $vnf-topology-operation-input.vnf-request-information.vnf-id + ' and generic-vnf-id = ' + $vnf-topology-operation-input.vnf-request-information.generic-vnf-id`"/></return></outcome></get-resource><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="vf-module:relationship-list" + key="vf-module.vf-module-id = $vnf-topology-operation-input.vnf-request-information.vnf-id + AND generic-vnf.vnf-id = $vnf-topology-operation-input.vnf-request-information.generic-vnf-id + AND related-to = l3-network" + force="true" + local-only="false"><outcome value='failure'> +<return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'An error occurred while deleting existing vf-module l3-network relationship in AnAI with with vf-module-id = ' + $vnf-topology-operation-input.vnf-request-information.vnf-id + ' and generic-vnf-id = ' + $vnf-topology-operation-input.vnf-request-information.generic-vnf-id + ' vf-module update FAILED.'`"/></return></outcome></delete><for index="i" start="0" end="`$service-data.vnf-topology-information.vnf-assignments.vnf-networks_length`"><save plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="vf-module:relationship-list" + key="vf-module.vf-module-id = $vnf-topology-operation-input.vnf-request-information.vnf-id + AND generic-vnf.vnf-id = $vnf-topology-operation-input.vnf-request-information.generic-vnf-id" + force="true" + local-only="false"> + + <parameter name="relationship-list.relationship[0].related-to" value="l3-network" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="l3-network.network-id" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$service-data.vnf-topology-information.vnf-assignments.vnf-networks[$i].network-id`" /><outcome value='failure'> +<block> +<set> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`' | An error occurred while saving l3-network relationship with network-id = ' + $service-data.vnf-topology-information.vnf-assignments.vnf-networks[$i].network-id + ' for vf-module with vf-module-id = ' + $vnf-topology-operation-input.vnf-request-information.vnf-id + ' and generic-vnf-id = ' + $vnf-topology-operation-input.vnf-request-information.generic-vnf-id`" /> +</set><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="vf-module:relationship-list" + key="vf-module.vf-module-id = $vnf-topology-operation-input.vnf-request-information.vnf-id + AND generic-vnf.vnf-id = $vnf-topology-operation-input.vnf-request-information.generic-vnf-id + AND related-to = l3-network" + force="true" + local-only="false"></delete><for index="i" start="0" end="`$tmp.AnAI.vfmodule.relationship-list.relationship_length`"><switch test="`$tmp.AnAI.vfmodule.relationship-list.relationship[$i].related-to`"><outcome value='l3-network'><for index="j" start="0" end="`$tmp.AnAI.vfmodule.relationship-list.relationship[$i].relationship-data_length`"><save plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="vf-module:relationship-list" + key="vf-module.vf-module-id = $vnf-topology-operation-input.vnf-request-information.vnf-id + AND generic-vnf.vnf-id = $vnf-topology-operation-input.vnf-request-information.generic-vnf-id" + force="true" + local-only="false"> + + <parameter name="relationship-list.relationship[0].related-to" value="l3-network" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="l3-network.network-id" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$tmp.AnAI.vfmodule.relationship-list.relationship[$i].relationship-data[$j].relationship-value`" /><outcome value='failure'> +<set> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$error-message + ' | An error occurred while during rollback of l3-network relationship for vf-module with vf-module-id = ' + $vnf-topology-operation-input.vnf-request-information.vnf-id + ' and generic-vnf-id = ' + $vnf-topology-operation-input.vnf-request-information.generic-vnf-id`" /> +</set></outcome><outcome value='not-found'> +<set> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$error-message + ' | An error occurred while during rollback of l3-network relationship for vf-module with vf-module-id = ' + $vnf-topology-operation-input.vnf-request-information.vnf-id + ' and generic-vnf-id = ' + $vnf-topology-operation-input.vnf-request-information.generic-vnf-id`" /> +</set></outcome></save></for></outcome></switch></for><return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Failed to update vf-module l3-network relationship in AnAI. ' + $error-message`"/></return></block></outcome></save></for><set> + <parameter name="service-data.oper-status.last-order-status" value="`$service-data.oper-status.order-status`"/></set><set> + <parameter name="service-data.oper-status.order-status" value="PendingUpdate"/></set><set> + <parameter name="service-data.oper-status.last-action" value="`$service-data.request-information.request-action`"/></set><set> +<parameter name="ack-final" value="Y"/></set><return status='success'> + <parameter name="error-code" value="200" /></return></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-vnf-topology-changedelete.xml b/platform-logic/vnfapi/src/main/xml/dg-vnf-topology-changedelete.xml new file mode 100644 index 00000000..6bb6392c --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-vnf-topology-changedelete.xml @@ -0,0 +1,53 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc='vnf-topology-changedelete' mode='sync'> +<block atomic="true"><switch test="`$vnf-topology-operation-input.vnf-request-information.vnf-id == $service-data.vnf-id`"><outcome value='false'> +<return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='vnf-id not found'/></return></outcome></switch><switch test="'$service-data.oper-status.order-status == Active'"> + +<!-- +leaf order-status { + type enumeration { + enum "Active"; + enum "PendingAssignment"; + enum "PendingCreate"; + enum "PendingUpdate"; + enum "Deleted"; + } +} +--><outcome value='false'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='Invalid last-order-status'/></return></outcome></switch><update plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="generic-vnf" + key="vnf-id = $vnf-topology-operation-input.vnf-request-information.vnf-id" + force="true" + local-only="false" > + <parameter name="orchestration-status" value="pending-delete" /> +</update><set> + <parameter name="service-data.oper-status.last-order-status" value="`$service-data.oper-status.order-status`"/></set><set> + <parameter name="service-data.oper-status.order-status" value="PendingDelete"/></set><set> + <parameter name="service-data.oper-status.last-action" value="`$service-data.request-information.request-action`"/></set><set> + <parameter name="service-data." value="vnf-topology-operation-input." /> +</set><return status='success'> + <parameter name="error-code" value="200" /> +</return></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-vnf-topology-delete.xml b/platform-logic/vnfapi/src/main/xml/dg-vnf-topology-delete.xml new file mode 100644 index 00000000..31e61868 --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-vnf-topology-delete.xml @@ -0,0 +1,74 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc='vnf-topology-delete' mode='sync'> +<block atomic="true"><switch test="`$vnf-topology-operation-input.vnf-request-information.vnf-id == $service-data.vnf-id`"><outcome value='false'> +<return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='vnf-id not found'/></return></outcome></switch><switch test="`$vnf-topology-operation-input.vnf-request-information.aic-cloud-region`"><outcome value='Other'> +<switch test="`$service-data.oper-status.order-status == Active`"><outcome value='false'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='Invalid order-status'/></return></outcome></switch></outcome><outcome value=''><switch test="`$vnf-topology-operation-input.vnf-request-information.aic-clli`"><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='Either aic-cloud-region or aic-clli must be present'/></return></outcome><outcome value='Other'> +<block> +<delete plugin="org.openecomp.sdnc.sli.resource.sql.SqlResource" + resource="generic-vnf-l3-network" + key="DELETE FROM GENERIC_VNF_L3_NETWORK WHERE vnf_id = $service-data.vnf-id" + force="true" > + +<outcome value='failure'> +<set> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="An error occurred while deleting generic-vnf, generic-vnf-l3-netweork or generic-vnf-vserver from GammaResource"/></set></outcome></delete><delete plugin="org.openecomp.sdnc.sli.resource.sql.SqlResource" + resource="generic-vnf-vserver" + key="DELETE FROM GENERIC_VNF_VSERVER where vnf_id = $service-data.vnf-id" + force="true" > + +<outcome value='failure'> +<set> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="An error occurred while deleting generic-vnf, generic-vnf-l3-netweork or generic-vnf-vserver from GammaResource"/></set></outcome></delete><delete plugin="org.openecomp.sdnc.sli.resource.sql.SqlResource" + resource="generic-vnf" + key="DELETE FROM GENERIC_VNF where vnf_id = $service-data.vnf-id" + local-only="true" + force="true" > + +<outcome value='failure'> +<set> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="An error occurred while deleting generic-vnf, generic-vnf-l3-netweork or generic-vnf-vserver from GammaResource"/></set></outcome></delete><delete plugin="org.openecomp.sdnc.sli.aai.AAIService" + resource="generic-vnf" + key="generic-vnf.vnf-id = $service-data.vnf-id" + local-only="false" + force="true" > + +<outcome value='failure'> +<return status='failure'> + <parameter name='error-code' value='500'/> + <parameter name='error-message' value="`'Failed to delete generic-vnf from AnAI with vnf-id = '+ $service-data.vnf-id`"/></return></outcome></delete></block></outcome></switch></outcome></switch><set> + <parameter name="service-data.oper-status.last-order-status" value="`$service-data.oper-status.order-status`"/></set><set> + <parameter name="service-data.oper-status.order-status" value="Deleted"/></set><set> + <parameter name="service-data.oper-status.last-action" value="`$service-data.request-information.request-action`"/></set><set> + <parameter name="service-data.vnf-topology-information." value="" /> +</set><set> +<parameter name="ack-final" value="Y"/></set><return status='success'> + <parameter name="error-code" value="200" /></return></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-vnf-topology-operation.xml b/platform-logic/vnfapi/src/main/xml/dg-vnf-topology-operation.xml new file mode 100644 index 00000000..8eea2a15 --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-vnf-topology-operation.xml @@ -0,0 +1,131 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc='vnf-topology-operation' mode='sync'> +<block atomic="true"><record plugin="org.openecomp.sdnc.sli.recording.FileRecorder"> +<parameter name="file" value="/opt/opendaylight/current/data/log/svclogic.log"/> +<parameter name="field1" value="__TIMESTAMP__"/> +<parameter name="field2" value="svc-topology-operation"/> +<parameter name="field3" value="`$vnf-topology-operation-input.sdnc-request-header.svc-action`"/> +<parameter name="field4" value="`$vnf-topology-operation-input.sdnc-request-header.svc-request-id`"/> +<parameter name="field5" value="`$vnf-topology-operation-input.service-information.service-instance-id`"/> +<parameter name="field6" value="`$vnf-topology-operation-input.request-information.request-id`"/> +<parameter name="field7" value="`$vnf-topology-operation-input.request-information.request-action`"/> +<parameter name="field8" value="`$vnf-topology-operation-input.request-information.source`"/> +<parameter name="field9" value="`$vnf-topology-operation-input.vnf-request-information.vnf-name`"/> +<parameter name="field10" value="`$vnf-topology-operation-input.vnf-request-information.vnf-type`"/> +<parameter name="field11" value="`$vnf-topology-operation-input.vnf-request-information.vnf-id`"/> +<parameter name="field12" value="`$vnf-topology-operation-input.vnf-request-information.generic-vnf-name`"/> +<parameter name="field13" value="`$vnf-topology-operation-input.vnf-request-information.generic-vnf-type`"/> +<parameter name="field14" value="`$vnf-topology-operation-input.vnf-request-information.generic-vnf-id`"/> +<parameter name="field15" value="`$vnf-topology-operation-input.vnf-request-information.tenant`"/> +<parameter name="field16" value="`$preload-data.vnf-topology-information.vnf-topology-identifier.vnf-name`"/> +<parameter name="field17" value="`$preload-data.vnf-topology-information.vnf-topology-identifier.vnf-type`"/> +<parameter name="field18" value="`$preload-data.oper-status.order-status`"/></record><switch test="`$vnf-topology-operation-input.vnf-request-information.vnf-name`"><outcome value='Other'><switch test="`$preload-data.vnf-topology-information.vnf-topology-identifier.vnf-name`"><outcome value='Other'><switch test="`$vnf-topology-operation-input.vnf-request-information.vnf-name == $preload-data.vnf-topology-information.vnf-topology-identifier.vnf-name`"><outcome value='false'> +<return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='request.vnf-name not found in preload-data'/></return></outcome></switch></outcome><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='No preload data found to match vnf-name'/></return></outcome></switch></outcome><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='vnf-name is required'/></return></outcome></switch><switch test="`$vnf-topology-operation-input.vnf-request-information.vnf-type`"><outcome value='Other'><switch test="`$preload-data.vnf-topology-information.vnf-topology-identifier.vnf-type`"><outcome value='Other'><switch test="`$vnf-topology-operation-input.vnf-request-information.vnf-type == $preload-data.vnf-topology-information.vnf-topology-identifier.vnf-type`"><outcome value='false'> +<return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='request.vnf-type not found in preload-data'/></return></outcome></switch></outcome><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='No preload data found to match vnf-type'/></return></outcome></switch></outcome><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='vnf-type is required'/></return></outcome></switch><switch test="`$vnf-topology-operation-input.vnf-request-information.vnf-id`"><outcome value='0'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='vf-modules vnf-id cannot be NULL or 0'/></return></outcome><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='vf-modules vnf-id cannot be NULL or 0'/></return></outcome></switch><switch test="`$vnf-topology-operation-input.sdnc-request-header.svc-action`"> +<!-- +leaf svc-action { + type enumeration { + enum "reserve"; + enum "assign"; + enum "activate"; // equal to commit + enum "delete"; // equal to commit + enum "changeassign"; + enum "changedelete"; + enum "rollback"; + } +} +--> + +<outcome value='assign'><block> +<block atomic="true"> +<switch test="`$vnf-topology-operation-input.vnf-request-information.generic-vnf-id`"><outcome value='0'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='generic-vnf-id cannot be NULL or 0'/></return></outcome><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='generic-vnf-id cannot be NULL or 0'/></return></outcome></switch><switch test="`$vnf-topology-operation-input.vnf-request-information.generic-vnf-name`"><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='generic-vnf-name cannot be NULL'/></return></outcome></switch><switch test="`$vnf-topology-operation-input.vnf-request-information.generic-vnf-type`"><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='generic-vnf-type cannot be NULL'/></return></outcome></switch><switch test="`$vnf-topology-operation-input.vnf-request-information.aic-cloud-region`"><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='aic-cloud-region cannot be NULL'/></return></outcome></switch></block><call module='VNF-API' rpc='vnf-topology-assign' mode='sync' ></call></block></outcome><outcome value='changeassign'><block> +<block atomic="true"> +<switch test="`$vnf-topology-operation-input.vnf-request-information.generic-vnf-id`"><outcome value='0'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='generic-vnf-id cannot be NULL or 0'/></return></outcome><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='generic-vnf-id cannot be NULL or 0'/></return></outcome></switch><switch test="`$vnf-topology-operation-input.vnf-request-information.generic-vnf-name`"><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='generic-vnf-name cannot be NULL'/></return></outcome></switch><switch test="`$vnf-topology-operation-input.vnf-request-information.generic-vnf-type`"><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='generic-vnf-type cannot be NULL'/></return></outcome></switch><switch test="`$vnf-topology-operation-input.vnf-request-information.aic-cloud-region`"><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='aic-cloud-region cannot be NULL'/></return></outcome></switch></block><call module='VNF-API' rpc='vnf-topology-changeassign' mode='sync' ></call></block></outcome><outcome value='activate'><block> +<block atomic="true"> +<switch test="`$vnf-topology-operation-input.vnf-request-information.generic-vnf-id`"><outcome value='0'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='generic-vnf-id cannot be NULL or 0'/></return></outcome><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='generic-vnf-id cannot be NULL or 0'/></return></outcome></switch><switch test="`$vnf-topology-operation-input.vnf-request-information.generic-vnf-name`"><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='generic-vnf-name cannot be NULL'/></return></outcome></switch><switch test="`$vnf-topology-operation-input.vnf-request-information.generic-vnf-type`"><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='generic-vnf-type cannot be NULL'/></return></outcome></switch><switch test="`$vnf-topology-operation-input.vnf-request-information.aic-cloud-region`"><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='aic-cloud-region cannot be NULL'/></return></outcome></switch></block><call module='VNF-API' rpc='vnf-topology-activate' mode='sync' ></call></block></outcome><outcome value='rollback'><block> +<block atomic="true"> +<switch test="`$vnf-topology-operation-input.vnf-request-information.generic-vnf-id`"><outcome value='0'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='generic-vnf-id cannot be NULL or 0'/></return></outcome><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='generic-vnf-id cannot be NULL or 0'/></return></outcome></switch><switch test="`$vnf-topology-operation-input.vnf-request-information.generic-vnf-name`"><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='generic-vnf-name cannot be NULL'/></return></outcome></switch><switch test="`$vnf-topology-operation-input.vnf-request-information.generic-vnf-type`"><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='generic-vnf-type cannot be NULL'/></return></outcome></switch><switch test="`$vnf-topology-operation-input.vnf-request-information.aic-cloud-region`"><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='aic-cloud-region cannot be NULL'/></return></outcome></switch></block><call module='VNF-API' rpc='vnf-topology-rollback' mode='sync' ></call></block></outcome><outcome value='changedelete'><block atomic="true"> +<switch test="`$vnf-topology-operation-input.vnf-request-information.aic-cloud-region`"><outcome value='other'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='aic-cloud-region can not be present for 1604 VNF changedelete'/></return></outcome></switch><switch test="`$vnf-topology-operation-input.vnf-request-information.aic-clli`"><outcome value=''><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='aic-cloud-region can not be present for 1604 VNF changedelete'/></return></outcome></switch><call module='VNF-API' rpc='vnf-topology-changedelete' mode='sync' ></call></block></outcome><outcome value='delete'><call module='VNF-API' rpc='vnf-topology-delete' mode='sync' ></call></outcome><outcome value='Other'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='svc-action not recognized'/> +</return></outcome></switch></block></method></service-logic> diff --git a/platform-logic/vnfapi/src/main/xml/dg-vnf-topology-rollback.xml b/platform-logic/vnfapi/src/main/xml/dg-vnf-topology-rollback.xml new file mode 100644 index 00000000..17245028 --- /dev/null +++ b/platform-logic/vnfapi/src/main/xml/dg-vnf-topology-rollback.xml @@ -0,0 +1,46 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.openecomp.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd" module='VNF-API' version='${project.version}'><method rpc='vnf-topology-rollback' mode='sync'> +<block atomic="true"><switch test="`$service-data.oper-status.order-status == PendingCreate`"> + +<!-- +leaf order-status { + type enumeration { + enum "Active"; + enum "PendingAssignment"; + enum "PendingCreate"; + enum "PendingUpdate"; + enum "Deleted"; + } +} +--><outcome value='true'><block atomic="true"><switch test="`$vnf-topology-operation-input.vnf-request-information.vnf-id == $service-data.vnf-id`"><outcome value='false'> +<return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value="`'vnf-id = ' + $vnf-topology-operation-input.vnf-request-information.vnf-id + ' not found in config tree'`"/></return></outcome></switch><switch test="`$service-data.oper-status.order-status == PendingCreate`"><outcome value='false'><return status='failure'> + <parameter name='error-code' value='400'/> + <parameter name='error-message' value='Invalid order-status'/></return></outcome></switch><set> + <parameter name="service-data.oper-status.last-order-status" value="`$service-data.oper-status.order-status`"/></set><set> + <parameter name="service-data.oper-status.order-status" value="Deleted"/></set><set> + <parameter name="service-data.oper-status.last-action" value="`$service-data.request-information.request-action`"/></set><set> + <parameter name="service-data." value="" /> +</set><return status='success'> + <parameter name="error-code" value="200" /></return></block></outcome></switch></block></method></service-logic> |