diff options
Diffstat (limited to 'ms/generic-resource-api/src/test/resources/svclogic/SUBNET-API_managed-network-notification.xml')
-rwxr-xr-x | ms/generic-resource-api/src/test/resources/svclogic/SUBNET-API_managed-network-notification.xml | 138 |
1 files changed, 138 insertions, 0 deletions
diff --git a/ms/generic-resource-api/src/test/resources/svclogic/SUBNET-API_managed-network-notification.xml b/ms/generic-resource-api/src/test/resources/svclogic/SUBNET-API_managed-network-notification.xml new file mode 100755 index 0000000..1654a83 --- /dev/null +++ b/ms/generic-resource-api/src/test/resources/svclogic/SUBNET-API_managed-network-notification.xml @@ -0,0 +1,138 @@ +<service-logic + xmlns='http://www.onap.org/sdnc/svclogic' + xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='SUBNET-API' version='${project.version}'> + <method rpc='managed-network-notification' mode='sync'> + <block> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log"/> + <parameter name="field1" value="__TIMESTAMP__"/> + <parameter name="field2" value="managed-network-notification"/> + <parameter name="field3" value="`$managed-network-notification-input.request-id`"/> + <parameter name="field4" value="`$managed-network-notification-input.managed-network-status.status.code`"/> + <parameter name="field5" value="`$managed-network-notification-input.managed-network-status.status.description`"/> + <parameter name="field6" value="`$managed-network-notification-input.managed-network-status.final-notification-indicator`"/> + </record> + <switch test="`$managed-network-notification-input.managed-network-status.status.code`"> + <outcome value="Success"> + <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="activateSubnet"> + <outcome value="success"> + <block> + <get-resource + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="SELECT * FROM VPE_POOL where vpe_name = $eipam-ip-block.ptnii-name ;" + pfx='tmp.vpe-pool-row'></get-resource> + <save + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="UPDATE EIPAM_IP_SUBNETS + SET status = 'ACTIVE' + WHERE entity_id = $eipam-ip-block.entity-id ; " + force='true' + pfx='pfx.eipam-subnet-row'></save> + <set> + <parameter name="eipam-ip-block.status" value="ACTIVE" /> + </set> + <save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block"> + <parameter name="eipam-ip-block.status" value="ACTIVE" /> + </save> + <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" resource="generic-vnf" key="generic-vnf.vnf-id = $tmp.vpe-pool-row.vpe-id" pfx="vpe-after"> + <parameter name="orchestration-status" value="Activated" /> + <parameter name="prov-status" value="NVTPROV" /> + </update> + <return status="success"></return> + </block> + </outcome> + <outcome value="Other"> + <block> + <save + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="UPDATE EIPAM_IP_SUBNETS + SET status = 'ACTIVATE_ERROR' + WHERE entity_id = $eipam-ip-block.entity-id ; " + force='true' + pfx='pfx.eipam-subnet-row'></save> + <set> + <parameter name="eipam-ip-block.status" value="ERROR" /> + </set> + <save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block"> + <parameter name="eipam-ip-block.status" value="EIPAM_ACTIVATESUBNET_ERROR" /> + </save> + <return status="failure"> + <parameter name="error-code" value="3000" /> + <parameter name="error-message" value="ActivateSubnet failure, need to manually activate in EIPAM" /> + </return> + </block> + </outcome> + </execute> + </outcome> + <outcome value="Other"> + <!--subnet and subnet_keys are deleted in the EIPAMPlugin--> + <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deallocateSubnet"> + <outcome value="success"> + <!--subnet and subnet_keys are deleted in the EIPAMPlugin--> + <execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="deletePool"> + <outcome value="success"> + <block> + <set> + <parameter name="eipam-ip-block.status" value="DELETED" /> + </set> + <return status="failure"> + <parameter name="error-code" value="2000" /> + <parameter name="error-message" value="Failure from NCS and deleted pool/subnet in EIPAM"/> + </return> + </block> + </outcome> + <outcome value="Other"> + <block> + <save + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="UPDATE EIPAM_IP_SUBNETS + SET status = 'DEALLOCATED' + WHERE entity_id = $eipam-ip-block.entity-id ; " + force='true' + pfx='pfx.eipam-subnet-row'></save> + <set> + <parameter name="eipam-ip-block.status" value="ERROR" /> + </set> + <save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block"> + <parameter name="eipam-ip-block.status" value="SDN_C_BACKOUT_ERROR" /> + </save> + <return status="failure"> + <parameter name="error-code" value="1000" /> + <parameter name="error-message" value="Failure from NCS and deletePool failed in EIPAM, need to manually delete." /> + </return> + </block> + </outcome> + </execute> + </outcome> + <outcome value="Other"> + <block> + <save + plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' + resource='SQL' + key="UPDATE EIPAM_IP_SUBNETS + SET status = 'DEALLOCSUBNET_ERROR' + WHERE entity_id = $eipam-ip-block.entity-id ; " + force='true' + pfx='pfx.eipam-subnet-row'></save> + <set> + <parameter name="eipam-ip-block.status" value="ERROR" /> + </set> + <save plugin="org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource" resource="eipam-ip-block"> + <parameter name="eipam-ip-block.status" value="SDN_C_BACKOUT_ERROR" /> + </save> + <return status="failure"> + <parameter name="error-code" value="1000" /> + <parameter name="error-message" value="Failure from NCS and deletePool failed in EIPAM, need to manually delete." /> + </return> + </block> + </outcome> + </execute> + </outcome> + </switch> + </block> + </method> +</service-logic>
\ No newline at end of file |